C# - Truncate Text In RadGrid Column?

using Telerik RadGrid* in a LINQ context, with ASP.NET/C#, how to truncate text to a maximum length when displaying in columns? By maximum, I mean if original string's length is shorter than the specified maximum length, no errors will raise.I have seen many examples of this on the net, but it seems that the Container.DataItem used to achieve this is different when using LINQ. Sometimes we see DataItem as a method, sometimes not. Examples are usually using a DataSet.Here's an example found (source) :
<asp:TemplateField HeaderText="Description">
<ItemTemplate>
<%# ValidateString(Container.DataItem("Description")) %>
[code]...

Web Forms :: Set Text Box Height According To (table Column) Textforums.asp.netI have a multiline text box on page which has style "overflow: hidden" to hide the scroll bar. I want to set the vertical hight of that text box at runtime according to the string coming from table column. Is there any way of doing it? I have tried to put the text in array but its not working....
Dim myParas As Object
myParas = Split(TextBox2.Text, vbNewLine)
ln = UBound(myParas) + 1
TextBox2.Height = 22 * ln

Forms Data Controls :: How To Change The Column's Name Of Dataset Programmatically With C#forums.asp.netBase on different conditions the progam uses different Sql which every one has different select names.
How can I change the Dataset Columns name programmitcally which matchs the FormView Order .
Or some how change the <%#Eval("Order")%> text in asp:TextBox
<asp:FormView
ID="DetailView"
runat="server"
Width="704px"
OnPageIndexChanging="DetailView_PageIndexChanging">
<ItemTemplate>
<table
height="400"
cellpadding="0"
cellspacing="0"
style="width: 511px">
<tr><td
width="%50"
valign="top"
>TR</td><td>
<asp:TextBox
ID="TextBox5"
Text='<%#Eval("Order")%>'
runat="server"
Width="192px"></asp:TextBox>
</td><td></tr>,/table>
</ItemTemplate>
</asp:FormView>

C# - Best Way To Add A Column To An Existing Datasetstackoverflow.comI have two extremely long queries that I am running on multiple tables, using an INNER JOIN. The only difference between these two queries is that they take different input values for one of the WHERE clauses, which they get from two separate DropDownLists. The results of these queries are identical, save for the time1/time2 columns.string query1 = "select Name = t1.name, time1=(SELECT hours FROM table3 WHERE street=list1.selectedvalue), t2.address from [table1] t1 INNER JOIN [table2] t2 ON t1.param = t2.param ORDER BY Name"

Edit Dataset Column Value In C#?stackoverflow.comi have dataset having one table have 5 columns fill data from database.
When i run application datatable contains more than 50 rows, I would like to update value of datatable after getting data from databse. My requirements are This table have few cells having Null value, I would like to replace null with "-" ? One column is System.datetime datatype, where i would like to remove time. I would only like to have date?
Here i am thinking that i apply one loop of rows present in datatable and update cells accordingly. But i am searching any direct update method?

Forms Data Controls :: Retrieve Column Data From GridView For RowDeleting In C#forums.asp.netThe date displays just fine in the grid. I am having trouble with deleting the row in the grid. I have researched and played with different things with the grid, but I can't seem to get it to work. Most examples are in VB and I coding is C#.
What happens is the code (see *** in C#) doesn't return the column 0 (UserName) from the GridView. So the next statement blows up becasue there is no UserName. I used a ASP.Net VB book I got from a VB class I took to come up with the code.
When I typed in "grdUsers.Rows(e.RowIndex)"... I got help from Intellisense, but the rest of the line ".Cells(0).Text"... I got no help.
I included below the code that I think is pertinent to the problem I'm having.
[Code]....

SQL Reporting :: How To Change Text In Columns In SSRSforums.asp.netI need to create a complex report and export it to Excel.
In the first column header, text is displayed as "Hide Daily Columns", but I need the text to change as "Unhide Daily columns" when I click on it and when the text changes the columns under "daily" header (I have 3 columns under this header) present in the report shud be hidden and only weekly columns shud be visible. I am new to SSRS and tried out many ways but didn't get it.

C# - Getting Text Of .NET HyperLinkField In GridViewstackoverflow.comI'm trying to get the text of a HyperLinkField in a GridView's OnRowDelete event (the HyperLinkField's text is the primary key of the row I wish to delete). I understand that you can't get the text using the code I've placed below; it only works for BoundFields (for HyperLinkFields, the string is ""). But, I've been unable to find a working answer for getting this text. How do I get the displayed text from a HyperLinkField? (VS2010 w/ ASP.NET 4.0 and C#)
GridView Design
<asp:GridView ID="teamGridView" runat="server" CssClass="gridView" RowStyle-CssClass="rowStyle"
AlternatingRowStyle-CssClass="altRowStyle" HeaderStyle-CssClass="viewsHeader"
OnRowEditing="Team_OnRowEditing" OnRowDeleting="Team_OnRowDeleting" OnRowUpdating="Team_OnRowUpdating" [code]...

C# - Modify Hyperlinkfield Text In Gridview?stackoverflow.comI am stumped on this one. I want to modify the text in a Hyperlinkfield of Gridview after the data is bound to it. I found similar code to this on msdn and I can't get it to work.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[2].Text = e.Row.Cells[2].Text + "random text";
}
I also tried similar code in the Page_PreRender event with no luck. I have also tried calling DataBind() before this one line of code with no help. I always just get "random text" in the cell without the data from the DB.

Web Forms :: How To Link .cs(class File) With .aspx.cs Fileforums.asp.neti have created basic .aspx files .one is login.aspx and registration.aspx...Now in my solution explorer i also added class file i.e StudentInfo.cs and wrote some properties in it...now my question is
1. i want to connect Studentinfo.cs class to my login.aspx.cs...So that i can call the methods in Studentinfo.cs..how to do it?

SQL Reporting :: How To Sort Column Field And Add TOTAL Column In VS 2008forums.asp.netI am in VS2008 and in ReporViewer's Design page.
I have "Fruits" as column fields and Months as row fields and Sales as data field.
I have these columns:-
Apple, Orange, Pear.
However, I want it be displayed as
Orange, Pear, apple.
Any work around ?
Also I need a 4th column adding the Apple, Orange and Peer numbers total. How to do it in design view in VS2008 ?

Read And Display Japanese Text From Text Filebytes.comI posted a question regarding reading japanese
text from a text file.
Well, since I solved the problem, I thought I'd post my solution for
the benefit of other people with the same problem.
The plan was to make a script to read and display japanese text. I
will use it for making a japanese proverb script and for a japanese
language study script.
Method :
I wrote a simple kanji text file (saved with UTF-8 encoding)
I wrote a simple PHP script to display the file contents (saved with
UTF-8
encoding)
I specified the content-type header for the HTML page :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
*** All files have the same encoding. ***
UTF-8 supports japanese characters.
and it works!
this is my PHP (and HTML) script :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>PHP : Japanese Text File Read : Exercise 1</title>
</head>
<body>
<?php
$filename="japanese.txt";
//open file
$fp = fopen($filename,'r');
//loop through each line in the file
while($line=fgets($fp))
{
//output current text file line
print $line."<br>";
}
//close file handle
fclose($fp);
?>
</body>
</html>
I know it's a very simple script, for testing purposes only. It
displays the contents of the japanese text file line by line.
The key was to save all files in the same encoding (I used UTF-8) and
to specify the encoding / charset in the HTML header (<meta
http-equiv="Content-Type" content="text/html; charset=utf-8">)

Jquery :: Text Input Fields That Display Instruction (placeholder) Textstackoverflow.comWhat's the best way to have a text input field that displays instructions of what to enter in that field in gray. When you focus on that input field, the gray instruction text disappears and your input text appears black. If you erase your input text and focus away from that input, then the instruction gray text reappears. I've tried implementing this with jQuery, but I get all kinds of weird issues with different browsers. Sometimes when you go back a screen, the instruction text becomes black and no longer disappears, issues like that. Is there a standard javascript library for this? I can't find any! the instruction text can't be an image because it has to be available in different languages depending on the browser's language preference.

JQuery :: Default Text On Empty Text Boxstackoverflow.comI have a email form text box that while it is empty I would like it to have the value "E-Mail" And when you click on it the text goes away. If someone clicks on it and doesn't enter text. on Blur I would like for it to return to having the default text.I have been trying a few things but nothing is working.

HELP!! Making Text Bold In Text Boxwww.codeguru.comi already posted this and i got help but the answers werent right. what i want to do is have a text box and three check boxes. one check box to make the text bold, one to make it italic and one to make it underlined. and when you enter text in the text box you can check the bold box and the text will turn bold right there. you dont check the box and then it turns to bold and from what you type from then on out is bold but instead it turns everything that is already in the box bold. some people told me to type if check is true then text1.fontbold. in when i do that it says invalid use of property. and i also tried text1.font.bold. please help me out!!

Three Columns Layout, Want Middle Column To Stretch Wider When Column 1 And 3 Are Empty?stackoverflow.comI have a 3 column layout using table-less design.
[code]....
The CSS:
#left {width: 200px;float:left;display:inline;}
#content {width: 600px;float:left;display:inline;padding: 0 10px;}
#right {width: 160px;float:left;display:inline;}
I am using a web application, and I can't change the layout. By can't change, I mean the div's with left/content/right cannot be removed.
On some pages, both the left and right columns are completely empty. And I want the #content div to expand more than the 600px.
is this possible, without altering the HTML?

How To Code For User To Press Enter To Execute Commandwww.vbcity.comHello All -I have a text box into which the user enters text commands. The way it's set up now, as soon as the requisite text appears in the text box the appropriate command is invoked. It's a very simple series of If...Then statements:Private Sub txtCmdLine_Change() If LCase(txtCmdLine.Text) = "new" Then txtCmdLine.Text = "" mnuFileNew_Click End If If LCase(txtCmdLine.Text) = "save" Then txtCmdLine.Text = "" mnuFileSaveAs_Click End If If LCase(txtCmdLine.Text) = "open" Then txtCmdLine.Text = "" mnuFileOpen_Click End If EtceteraHow can I "interrupt" the process so that the user must press the ENTER key after typing in the text command?Thanks very much,SZW

Regex - Regular Expression To Parse Whitespace-delimited Data?stackoverflow.comI have written code to pull some data into a data table and do some data re-formatting. I need some help splitting some text into appropriate columns.
CASE 1
I have data formated like this that I need to split into 2 columns.
[Code]...
column is the first 11 characters That is easy.column 2 should contain all the text after the first 11 characters up to but not including the first number.The last column is all the text after column 2

Forms Data Controls :: Copy From One Textbox To Another In Gridviewforums.asp.netI have 2 text boxes and a button within an EditItemTemplate field in a simple GridView:
<asp:TemplateField
HeaderText="Text">
<EditItemTemplate>
<asp:TextBox
ID="txtText1"
runat="server"
/>
<asp:Button
ID="bntCopy"
runat="server"
Text="Change"
/>
<asp:TextBox
ID="txtText2"
runat="server"
Text='<%#
Bind("text") %>' Enabled="false" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label
ID="lblText"
runat="server"
Text='<%#
Bind("text") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
how I can transfer the text from the txtText1 Textbox to the txtText2 one when I press the btnCopy button, but preferably in the codebehind so that I can change the text before actually copying?

C# - Using JSON In .Net?stackoverflow.comWhat libraries are available to handle JSON in .Net? I've seen this: [URL]..but would prefer a native library, if possible.

C# - Turning HTML Div Code Into A Control?stackoverflow.comI have bunch of HTML code I am using to make rounded edge boxes on my controls. Is there a way to take this code and turn it into some kind of control or something so I do not have to keep pasting 10 lines of HTML code around everything I do?
<div id="BottomBody">
<div class="box1024" >
<div class="content1024">[code]....
One additional thing to note, the number HTML tags used inside the inner most DIV will change depending on where I use it in my site. So in some cases I will only have 1 tag and 1 tag but in other cases I could have 1 tag, 1 tag, 3 tags, and a HTML table. How can I make that work?

Want To Create Html Link Using C# - Dynamically.forums.asp.netI have a link in my site like this.
<a href=""><fontstyle="font-size:small;font-family:Arial;"id="mylink">Please Click here to see Details.</font></a>
I want to create this link dynamically (In the button click) using C#.I am looking for a normal html control. I am not using linkbutton.

C# - How To Insert Image In Html Action Linkstackoverflow.comI have navigation and many link on my webproject from html action links. They are ugly with underline. I would like to insert some image with name or play with styles of action link.Is it possible? How to do that?

C# - Bind Event To Generated Html Link?stackoverflow.comI generate in a foreach loop html links ("test which I add to a pre defined literal.ow can I add a void to the generated html link? I tried with runat server and onclick.. but does not work..Goal is to add by the onclick a pre defined void from a API.

Layer Link Column Missingforums.adobe.comtrying to upgrade my PS skills and working thru a PS CS book. I am working on a Layer session. The books shows a column that they call Layer Link mode. I is just to the right of the Visibility column.

Creating Columnwww.mogo-media.comCreate Character Sequence
Using Adobe Illustrator or Adobe Photoshop.
Create Character Sequence.
Image Size 2600x1950 pixels.
Rows 50:Columns 100.
Each Cell Size 26x39 pixels.
this is a 640 x 480 example of the 2600 x 1950 they show

How To Put 3 Column Guide For Website...forums.adobe.comHow can i put a 3 column guide in PS like I am building a website? This way I can use each section on its own and know where my boundries are. I guess I could just draw a line, but I want something that I can adjust quickly.

Single Row/column Marquee Toolwww.photoshopgurus.comI have used PS7 for many years but have never found a practical use for the single row/column marquee tool,am i missing something? could someone enlighten me as to practical uses.

C# - Parse CSS Out From <style> Elements?stackoverflow.comtell me an efficient method of retrieving the CSS between tags on a page of markup in .NET?I've come up with a method which uses recursion, Split() and CompareTo() but is really long-winded, and I feel sure that there must be a far shorter (and more clever) method of doing the same.it is possible to have more than one element on a page, and that the element can be either or .

C# - XML Serialization In .NET?stackoverflow.comI have xml like this:
<?xml version="1.0" encoding="utf-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="blah@blah.com" start="2011-10-03T15:09:30.481Z">
<ls>
[code]....
Why is XMLSession.FileList.Count always 0. I hypothesize it has something to do with the declaration above it but I am not sure what is wrong with it. Maybe it can't accept a path, if not, how can I do it?

C# - .Net XML Serialization Based On A XSD?stackoverflow.comI've been serialising and deserialising .net objects using the XmlSerializer class without problem, however we now need somebody else to look at that data to perform some analysis on it.In order to help with that we've produced an XSD based on our class like so:
xsd.exe /t:DataClass Assembly.exe
The start of the XSD looks like this:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DataClass" nillable="true" type="DataClass" />[code].....
Bizarly, the XML produced does not adhere to the XSD generated from the same class.My question then is, is there a way of telling the XmlSerializer to serialize the object based on a given XSD? As an aside, I've looked at other ways of fixing this: I've tried re-generating the classes from the generated XSD - this seemed to have the same problem.

C# - Serialization Across Projects With Inheritance?stackoverflow.comI have a base class ("MyBaseClass") in a project called "BaseFramework" which is included in several solutions within the company. There are several derived class's in various projects throughout the company that inherit from "MyBaseClass". If I then create a List and add derived class's to it, it will not serialize. I realise that if I were attempting to serialize this list, and the base class and derived class were in the same project, I could simply apply the "XmlInclude" attribute to the base class and include all of the derived class's. This is however not possible across projects, because that would require a circular dependency.

C# - XML Serialization Assembly For Non-web Projectsstackoverflow.comI am attempting to solve the well known problem of automatically generated serialization assemblies in VS 2010, both VB.NET and C#. The "Generate Serialization Assemblies" option in project settings does nothing for non-web projects (see [URL]). Thus the calls to serializers generate file i/o exceptions that are very unfortunate, and for which there is no cure. The method suggested above does not appear to work with VS2010 and SGEN still runs with /proxytypes enabled.

C# - How To Serialize Only Some Properties In .Netstackoverflow.comThis is for a web project so i have several classes that inherit from Web.UI.
I only want to serialize very particular properties (basically, only local properties)
I'm aware of the XMLIgnore property that can be placed on a property to ignore items, but this won't work in my context since that would require modifying a bunch of stuff that i really don't want to modify (and probably can't).
So how do i tell the xml serializer to ignore everything except for X and Y or tell it to seralize just X and Y?
i could just create my own xml in a string builder or something and if that's the only way, so be it. however i'm looking for a method that will employ the built in XML stuff.

Flex :: Actionscript 3 - Property Like 'visible Columns' In Advance Data Gridstackoverflow.comI want to some how control the visibility of some columns in my advance data grid. I have a data provider with 115 coumns out of which I want to hide few columns. I know the column index and header field of these columns. Is there some property in Advance data grid where I can specify this directly?

C# - Angle Brackets In Page Head Element?stackoverflow.comPHP experience (which meaby is causing this problem) and Iam having small problem passing data from codebehind to view-source.
I declared string variable on codebehind side such as:
...
public string mystring = "Scotty";
protected void Page_Load(object sender, EventArgs e)
{
...
So now I want to use it in view-code but when I put it in angle brackets (<%: or <%=) and put it in head element I got no access to this value. On the other hand when I put it in BODY element everything is ok.
My failing example (simplified):
<head runat="server">
<script language="javascript">
function beamMeUp()
{
alert(<%=mystring;%>);
}
</script>
</head>
<body>
<input type="button" onclick="javascript:beamMeUp" value="Warp6" />
</body>
why I can't use it (the <%=mystring;%>) in HEAD but i can use it in BODY ?

C# - Import MD5 Passwords From A PHP App?stackoverflow.comSo I'm in the process of writing an ASP.NET application that requires to import users from a PHP application. The passwords were hashed using MD5 into the database, so the user table records looks more or less like this:
user Password
user1 827ccb0eea8a706c4c34a16891f84e7b
user2 e10adc3949ba59abbe56e057f20f883e
And so on. I have access to the PHP source code and I can see that there is no salt or anything else, it is juts a straight MD5 application. Now, Back on my ASP.NET, I tried to use MD5 using the following logic:
[Code]....
Problem is, that is returning strings like 50-F8-4D-AF-3A-6D-FD-6A-9F-20-C9-F8-EF-42-89-42, which of course is not going to match with the information in the database. What should I do so I don't have to reset 500+ user passwords?

C# - How To Open A Link In A New Windowstackoverflow.comI have a button which redirects the user to another page. Instead, I would like this button to open a new window that points to this location.
aspx:
<asp:ImageButton ID="img_url"
CommandName='<%#Eval("url") %>'
OnClick="img_url_Click"
runat="server"
ImageUrl="~/images/products_details.png"
/>
cs:
protected void img_url_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = sender as ImageButton;
Response.Redirect(img.CommandName.ToString());
}

C# - Open Link In A Different Panel?stackoverflow.comI have a page that dynamically generated a list of links to a web page (aspx) that opens an image. I do not have direct access to the PDF, only through the ASPX. The code behind is C#.
So if I have a page that has codes that looks like this
[code]...
How do I open the view.aspx link in the cell labels 'Open Image Here'?

Hyperlink Column In Gridview - Getting Error On Clicking Linkforums.asp.netI have a site with a functioning database for members displaying location info. One column is shows their web address. When I set this column to be a hyper link column and then go online and click the link, I get an error. It seems that the database thinks this link should point to a page within the site instead of the home page of a completely different web site url. What property do I need to set to get the link to send the visitor to the member web site? I used VWD 2005 to create the site and use SSMS Express for changes on the remote server.

C# - How To Create Simple Stacked/segmented Html Barstackoverflow.comRather than try to reinvent the wheel, how to create a stacked/segmented bar or point me to an existing control. Here's what I need:
Horizontal bar
Standard html
Each segment needs to be color coded from css
Each segment needs to be a percentage of the total (i.e. if total value = 100, then a value of 10 for one of the segments would be smaller than a value of 50)
Should be able to fit seamlessly into an html table cell
Should not be an image
Should only create a single bar with segments (not multiple bars/segmented bars)
Server-side generated, no AJAX
This should be as simple as possible given x number of values, create x segments.
I'm looking for code examples or already-built controls.
EDIT: For completeness:
int[] segments = { 10, 5, 45, 20, 20 };
Panel horizontalBar = new Panel();
for(int segmentIndex = 0; segmentIndex < segments.Length; ++ segmentIndex)
{
horizontalBar.Controls.Add(new Panel() { ID = String.Format("segment-{0}", segmentIndex), Width = Unit.Percentage(segments[segmentIndex]), CssClass = "segment" });
}
this.Page.Form.Controls.Add(horizontalBar);

C# - Get The Full Path From A Fileupload?stackoverflow.comWhen I'm using the file upload control I just get only the file name, but I want to get the full path of the file location.
How do I get the full path from the file upload control in ASP.NET?

C# - How To Get Full Path Of Downloaded Filestackoverflow.comi want to find the downloaded files full path.
in my case. iam replacing some data in document and saving in client side. so itz automaticaly saving in thw client side(normally in the Temp folder). i want to get that full path from the client side.
code
Response.AppendHeader("Content-disposition", "attachment; filename=myword.docx");

How To Return The Full File Path In A C# Web Applicationstackoverflow.comI have a VS 2008 web application that I need to capture the full file path (directories and file name) from the selected file. So user selects a file and then clicks on one of the buttons which transfers control to my code for processing. So how do I get the file path? I can get the file name, but not the path.

How To Control On HTML Elements By Using C# Codeforums.asp.netHow can I control on HTML elements by using C# code in asp.net pages.
For example:
I want to change the content of span tag or td tag when load page... that's mean write code c# in Default.aspx.cs for example to change Span content

C# Sample Code Library Of Comon Tasks / Boiler Plate Codestackoverflow.comanyone use/ know of any library or website with code snippets or samples with many of the mundane boilerplate code and/ or functions like data access, data scrubbing, recursive routines...
preferably c# since most of .net in the real world is c#. VB is ok too.

C# - MVC Action With ApplicationPath?stackoverflow.comi'm creating a mvc application and i'll use under subdomain like http://myapp.mycompany.com
This subdomain is pointing to app subdirectory, but my actions are always generated with applicationPath (subdirectory) like:
http://myapp.mycompany.com/myapp/Home/About
// I want just this without additional paths
http://myapp.mycompany.com/Home/About
Is there any configuration related to this?
Is this the correct way to generate links?
<%= Html.ActionLink("About", "About", "Home") %>

C# - What Is The Most Popular Website Writtenstackoverflow.comI am trying to justify writing a website in asp.net that has the potential to be as large as wikipedia. Are there any large websites content driven websites that have been written asp.net?

C# - Can Determine If There Is An Open Source Software For A Specific Purposestackoverflow.comWe are going to write an entire new application for a reservation system. In this system experts specify their free time in elaborated calendar and users seek them through searched and finally reserve the expert and his time.
We prefer to find an open source program like this and try to evolve it instead of creating it from scratch. In this manner our time is saved and that open source program will be completer too.

C# - Read Data From SqlDataReader?stackoverflow.comI have a SQL Server 2008 database and I am working on it in the backend. I am working on asp.net/C#
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
//how do I read strings here????
}
I know that the reader has values. My SQL command is to select just 1 column from a table. The column contains strings ONLY. I want to read the strings (rows) in the reader one by one. How do I do this?

C# - Use UserControl To Display SqlDataReader Data?stackoverflow.comi try to use userControl to display SqlDataReader data.
in the main page
public SqlDataReader Data2;
...
<uc1:WebUserControl ID="WebUserControl1" RData1="<%=Data2 %>" runat="server" />
and in the userControl
Repeater1.DataSource = RData1;
Repeater1.DataBind();........
But i keep getting this error
Cannot create an object of type 'System.Data.SqlClient.SqlDataReader' from its string representation '<%=Data2 %>' for the 'RData1' property.

C# - Replace Hard Coded Values With Database Values?stackoverflow.comI'm trying to implement this tag cloud:
[URL]
...and I need the replace the hard-coded values below with those coming from my database?
[code]....
I've created the following sql string which returns the data in the format expected string/int or value/key
SELECT Tag, COUNT(Tag) AS Counter
FROM dbo.CtagCloud
GROUP BY Tag
HAVING (COUNT(Tag) > 3)
ORDER BY Counter DESC

C# - Getting Variable Values Out Of XSLT File?stackoverflow.comI wanted to find out if there is a way of getting a parameter or variable value out of an XSL file. For example, if I have the following:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="username" select ="usertest"/>
<xsl:variable name="password" select ="pass"/>
<!-- ... -->
</xsl:stylesheet>
I would like to read the username and password values from the XSL and use them for authentication. I am using ASP.Net and C# to perform the actual transform on an XML file.
share code with me that would allow me to read the XSL variables from ASP.NET/C#.

C# - Change Rendering Order Of Controls?stackoverflow.comI found this article on how to manipulate the rendering sequence of asp.net controls.: [URL]I placed some placeholders on the page to encapsulate the controls i want to move around. The problem is, that RenderChildren does render the controls without the html i placed into the placeholder like this:
<asp:PlaceHolder id="phOneToMove" Runat="server" Visible="true">
<tr>
<td><asp:Literal id="label1" Runat="server">Caption</asp:Literal></td>
<td>
<asp:TextBox ID="textbox1" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="validator1" Enabled="true" ControlToValidate="textbox1" runat="server" EnableClientScript="False" ErrorMessage="error"></asp:RequiredFieldValidator>
</td>
</tr>
</asp:PlaceHolder>
The controls are rendered without the tr and td around.How can I handle this? All I want is to change the order of the placeholders like in this example phOneToMove.

Forms Data Controls :: Resize The Gridview Columns?forums.asp.netI m creating my application in ASP.NET 2005 with C# and SQL SERVER 2005.
In asp.net standard control i have used the multiline textbox in my application and on the click event the date displays in gridview.
I have used the textbox for storing the address which contains the atleast 3-4 lines...
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" autogeneratecolumns="false"
AutoGenerateDeleteButton="false" AutoGenerateEditButton="false"
DataKeyNames=id>
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:boundfield datafield="id"
readonly="True"
headertext="ID"/>
<asp:boundfield datafield="address"
headertext="Address"/>
</Columns>
</asp:GridView>
I think the columns of the gridview are not resizable.They are predefined for each column...
Now,what i want it to look or display should be as ::
ADDRESS
Name of apt,soc
Opp or near by
Area name
I want to display the text in the gridview in the same way as above. The values are stored in the database and i get them thru sqldatasource...

Forms Data Controls :: Insert Data Using EntityDataSource In FormView - C#forums.asp.netI am new to formview .My formview works fine, when I insert data into the database directly and then do an update on it. It throws an error when I try to insert a new record. The error just says
"An error occurred while updating the entries. See the inner exception for details."
How to insert data into the table using an entity dastasource?

Integrate HTML / Design With C# Code In MVC?stackoverflow.comWe're working on a new ASP.Net site. The last major site we did was in classic ASP--the procedure we used there was to have the HTML completed first, then "bring it to life" with the ASP code.
In the ASP.Net world, how does this work? I.e. how do the designers do their work if much of the mark-up is actually being generated by the server controls?
We are also looking at ASP.Net MVC as a potential lightweight alternative.
Would be very interested to know what was worked best for people in both scenarios in terms of working with the designers and integrating their work with the code.
UPDATE: I refined what I was asking here, not exactly the same question but similar enough so this one could probably be merged with it.

C# - How To Get Date And Time Formats Based On Culture Infomationstackoverflow.comWhat I want is..If culture is en-US then
string dateFormat="MM/dd/yyyy";
string timeFormat="24.00 hrs";
If culture is en-GB then string dateFormat="dd/mmyyyy";
string timeFormat="24.00 hrs";
and so on for other countries..Now how do I get these date and time format values ? What are the standards? Like which all countries use similar date/time formats and which ones don't ?ok I tried this :- DateTime myDate = new DateTime();
string us = myDate.ToString(new CultureInfo("en-US"));
string us gets value =1/1/0001 12:00:00 AM
Now how do I extract "dd/mm/yyyy" and "24.00 hrs" out of this...in my Dateformat column in my Table... I want to store STRINGS such as dd/mm/yyyy or mm/dd/yyyy NOT dates..In my TimeFormat column in the table, the values to be stores are STRINGS too, like I need to store either "24:00hrs" or "12:00hrs"
How do I do this now ?**using ShorTimePattern returns these values as h:mm tt and HH:mm
If I want to store the values in my DB exactly as "24:00hrs" and "12:00hrs", how do I use these values..h:mm tt and HH:mm,which one is for 24 hr format and which for 12 hr format ?**I want the information about Decimal Separator and Thousand Separator too based on the CultureInfo...whats the property for that ?

How To Update Particular Column Values Of Gridview On Specific Dates Using Vb.netstackoverflow.comI have column in database
ID From To s1from s2to s2price fare
1 Delhi Manali 17-Dec-2010 19-Dec-2010 $900 $600
2 USA Canada 18-Dec-2010 20-Dec-2010 $500 $800
3 Newyork salinas 19-Dec-2010 22-Dec-2010 $760 $1000
I want when any user search For: Delhi to Manali on between 17-Dec-2010 to 19-Dec-2010 then the price would be automatically changes to $900 in gridview else the default price wold be displayed in fare is $600 if he search for DelHi to Manali after 19-Dec-2010.
I m confused how to implement this logic ... using vb.net ...

Difference Between Asp And C# ?stackoverflow.comAre asp and c# completely different things or ..?
Is asp a language or asp.net? Are c, c++, c# languages?
What is a framework, stack, language

MVC ::difference Between C# And VB.NET?forums.asp.netI am in the process of learning MVC, and thought I would parallel the work in both C# and VB.NET. I ran into a snag when right-clicking in an action method inside of a controller to add a view - in C# if I choose to strongly type the view it includes all the objects in the models folder in the drop-down list for selection; however, in VB.NET none of the models are available in the list. Is there some step I need to take in order to make the models objects available in the drop down for selection?

C# - Creating A Generic Data Editing User Control?stackoverflow.comI have a user control which has a Gridview and a listview, I want to make this control generic so that I can just pass the type of the class I want to edit, which would be a linq entity, and then it would automatically do the rest, so far I havent had any success and I was wondering if anybody knows a tutorial or some info about doing this?

C# - Exception Handling Internal Bug?stackoverflow.comCode:
public static void Test()
{
try
{
OpenConnectionToDatabase(); //Opens a connection to Oracle DB
} catch(Exception e)
{
e.Data.Add("Query:", command.CommandText);
throw e;
}
}
When this code is executed when the Database server is being shutdown and the communication is disrupted, .NET throws the following error: Item has already been added. Key in dictionary: 'Query:' Key being added: 'Query:' at System.Collections.ListDictionaryInternal.Add(Object key, Object value) How can this be?

C# - .NET Exception Handling Lookup From A Table?stackoverflow.comMy manager designed a table exactly like this
[Exception]
PK | ExceptionId
ExceptionCode varchar(100)
ExceptionDesc varchar(255)
ExceptionMSG varchar(255)
I'm using ASP.NET Webforms and using stored procedures/ADO.NET for DataAccess. Now he does not want me to hard code validation in stored procedures nor in the code behind, but to catch the constraint exception message and look up the same error message in the database and look for the message that we want to show. I wonder if his design will work or should I explain to him that something is wrong here.

C# - How To Return A Value Based On The Type Of The Generic Tstackoverflow.comI have a method like:
public T Get<T>(string key)
{
}
Now say I want to return "hello" if the type is a string, and 110011 if it is type int.
how can I do that?
typeof(T) doesn't seem to work.
I ideally want to do a switch statement, and return something based on the Type of the generic (string/int/long/etc).

C# - SOAP Generic Type Serialization?stackoverflow.comWe have created a class to wrap the payload of web service response with common information as follows.
public class ItemResponse<T> : Response
{
/// <summary>
[code]...

C# - Using Outputcache Together With Urlrewritingstackoverflow.comI've got a problem using outputcache together with urlrewriting. We've got an application that rewrites url (IE [URL]). Based on the URL (/about/) we figure out which content to show. Now we're trying to add outputcache to that page:
< %@ outputcache duration="600" location="Server" varybyparam="Custom" varybycustom="RawURL" %>
And in the Global.asax we override GetVaryByCustomString like below:
public override string GetVaryByCustomString(HttpContext context, string custom)
{
if (custom == "RawUrl")
{
return context.Request.RawUrl;
}
else
{
return string.Empty;
}
}
However, when we publish the page i'd like to invalidate the cache so that the editors see the change directly. But no matter what I try, I cannot seem to invalidate the cache. If I'd like to invalidate "/about/" I would like to do this: HttpResponse.RemoveOutputCacheItem("/about/"); That doesn't work unfortunately. The only thing that seems to work is: HttpResponse.RemoveOutputCacheItem("/page.aspx");
This clears the cache for all my pages, not just "/about/". Is there any way to invalidate the cache based on the url? Or should we provide a cache key or something per page to be able to invalidate the cache programmatically?

C# - Enable OutputCache With An IHttpHandler?stackoverflow.comI have an IHttpHandler that I would like to hook into the OutputCache support so I can offload cached data to the IIS kernel. I know MVC must do this somehow, I found this in OutputCacheAttribute:
public override void OnResultExecuting(ResultExecutingContext filterContext) {
if (filterContext == null) {
throw new ArgumentNullException("filterContext");
}
[Code]....

C# - Paging In Gridview In Webformstackoverflow.comi am paging my grid view datas. now am on 3rd page of gridview. in 3rd page i have list of buttons in each rows. when i click on one button it goes to another webpage. where i edit datas and save. when i click on save it comes back to page having grid..which loads from 1st page of grid...i want to load the 3rd page of gridview itself.

C# - Can Create A PDF Quotation File From Winformstackoverflow.comAssuming i have a winform that has a button called "Create a Quote". Once user clicks it, a PDF File gets created on desktop. The PDF File has a fixed design/structure e.g. the logo is at the top left corner, the headers are fixed, etc. However, the data it self is pulled from a database.
As you see above, Quotation #, Description, Qty, U.P (USD), T.P (USD) records should be fetched from the db and dumped in the pdf template then create the pdf for user.

C# - How To Efficiently Send Large Files From The Database To The Browserstackoverflow.comIn my web application I am working with files. Some files are very large. I use Response.Write() to write the file to the browser. This goes well for the smaller files, but for large files this can take a while and the bandwidth is fully used.
Is it possible to split large documents and send it piece by piece to the browser? Are there other ways to send the document quicker to the browser?I hold the document as a property of an object.

Create 3 Columns Layout With Left Right Column Fixed And Middle Coloum Stretch?forums.asp.neti have a master page , i have 3 columns in a row, i have placed the content page in the middle column . and to the right and left columns there r some buttons and images, now I want my right n left columns with a fixed width 160px and the middle column should stretch automatically to fix in to the width of the screen
<form
id="form1"
runat="server"
style="width: 100%; height: 600px;">
[Code]....

SQL Server :: Copy Data From Multiple Columns Into One Column?forums.asp.netMy View has four columns with years, none of the rows have complete yearly data.
Current View
Columns 1-10, FY, Expr1, Expr2, Expr3
Some data, 2010 NULL,NULL, NULL
Some data, NULL, 2010, NULL, NULL
Some data, NULL, NULL, 2010, NULL
Some data, NULL, 2010, 2010, 2010
Some data, 2010, NULL, 2010, 2010,
Some data, NULL, NULL, 2010, NULL
Some data, 2010, 2010, NULL, 2010
Some data, NULL, NULL, NULL, 2010
A new column needs to relfect 2010 for each row in the View.
Goal New View
Columns 1-10, FY_NEW
Some data, 2010
Some data, 2010
Some data, 2010, etc. for each row in the view
I can not hard code the data as time moves forward next year rows will have 2012, etc.
How can I get lthe year, in this case 2010, into a new column regardless of the year?

Show A Text Value In A Column In Gridview In .net?stackoverflow.comI have a GridView to show user detail like name,phone,and status(active,suspend).my problem is that in database the user status in from of integer like 1 for Active and 0 for suspend.now while i am showing data to user in GridView I want to show Active and suspend Text according to status in database 1 or 0. I am not getting where to check for this condition in Asp.Net I am new in asp. I have done it in php also.like
if($fetch->user_status==1)
echo "Active"
else
echo "suspend"

Get The Global Width Of A Column-width Layout For A Random Text?stackoverflow.com<div id="multiColumn">a random and long text</div>
#multiColumn {
height: 320px;
-webkit-column-width: 200px;
-webkit-column-gap: 20px;
background: #ccc;
}
With a random text, how do I get the total width of a multi-column layout?
I think I found a solution. However it's not the most elegant...
#multiColumn {
background: #ccc;
width: 200px;
}
[Code]....