Forum Array

C# - How To Bind NameValueCollection Variable To Datalist Tag In The Markup

I am using an asp.net/c# datalist. <asp:DataList ID="EquipmentList" RepeatColumns="5"..... I have the following line inside the <ItemTemplate> tag: <a href=""><%# {I want to put something here but dont know how} %> </a> In my code behind I have a NameValueCollection variable that contains all strings: NameValueCollection myListofStrings = //calling a method here that populates myListofStrings this.EquipmentList.DataSource = myListofStrings; this.EquipmentList.DataBind(); can someone tell me how to bind this NameValueCollection variable to my datalist tag in the markup? Also additional knowledge on how to bind a datalist to a dataset, sqldatareader, IList<> but for now what do I write inside the tag if lets say i HAVE to bind to a NameValueCollection variable like in my case above. It has no properties or columns so I cannot write anything like Eval("propertyname") which is the answer that most here gave me. It is just like I am binding it to an array of strings. So what do I write now?

View Answers

Very Similar Questions

C# - Getting Variable Values Out Of XSLT File?
stackoverflow.com
I 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#.

Web Forms :: How To Link .cs(class File) With .aspx.cs File
forums.asp.net
i 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?

Visual Studio :: Remove The <head></head> Tag From And All Information Contained In The Tag
forums.asp.net
I have several hundred html files that I want to remove the <head></head> tag from and all information contained in the tag. I am fairly sure I can do this in Visual Studio using the Find and Replace In Files with REGEX.

C# - Can't Pass A Variable To A User Control?
stackoverflow.com
I am using the below example code and have a problem where I can't pass the Request.RawUrl value into an object that extends the Control object (class Test below).When I use the line: <Test1:Test runat="server" ID="testControl" Target="<%# Request.RawUrl %>"></Test1:Test> I find that the Target property is never called.If I use this line instead: <Test1:Test runat="server" ID="testControl" Target="<%# Request.RawUrl %> test"></Test1:Test> the string value "<%# Request.RawUrl %> test" is passed to the Target property.f I use this line as explained in many posts online: <Test1:Test runat="server" ID="testControl" Target="<%= Request.RawUrl %>"></Test1:Test> the string value "<%= Request.RawUrl %>" is passed to the Target property.I need to get the value of Request.RawUrl passed to the Target Property of my Test control object. Does anyone have any ideas where I am going wrong?Control: namespace Testing { public class Test : Control [code]...

C# - Setting Class-Level Variable To Use Between Event Handlers?
stackoverflow.com
I'm having a hard time understanding why the following code doesn't work. I'm sure it's something remedial that I'm missing or not understanding. I currently have a page that asks for user input. If, based on the input and logged in user, I find data from this page already in the database, I need to update the existing records rather than creating new ones, so I set a class-level bool to true. The problem is, when MyNextButton is clicked, PreviouslySubmitted is still false. So, I'm not sure how to make the value of this variable persist. public partial class MyForm : System.Web.UI.Page { private bool PreviouslySubmitted; protected void Page_Load(object sender, EventArgs e) { MyButton.Click += (o, i) => { q = from a in db.TableA where (a.SomeField == SomeValue) select a; if(q.Any()) { PreviouslySubmitted = true; //populate the form's fields with values from database for user to revise } } MyNextButton.Click += (o, i) => { //the value of PreviouslySubmitted is false at this point, //even if I made sure it was set to true the previous postback if(PreviouslySubmitted) { //update database } else { //insert into database } }

C# - Parse JSON String Into DataSet?
stackoverflow.com
I have to the replication.That time have to pass String as JSON {"Table1" : [ {"Name" : "MyCustomer","Description" : "cutomer","Status" : "1"}, {"Name" : "Kiraa","Description" : "My","Status" : "1",}[code]...... This is my format of JSON result. I want to convert to DataSet.I have installed JSON.NET library. I am using C#.net public bool convertJSONToDataSet(string strBusinessUnit, string strExecutiveCode, string strTableName, String jsonContent) { DataSet dataset = JsonConvert.DeserializeObject<String>(jsonContent);[code]..... here this statement is wrong DataSet dataset = JsonConvert.DeserializeObject<String>(jsonContent); how to covert to a JSON string to a Dataset.

C# - Using JSON In .Net?
stackoverflow.com
What 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.com
I 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.net
I 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 Link
stackoverflow.com
I 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.com
I 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.

C# - Extract Images Link From Html Text String?
stackoverflow.com
I want to extract all images link to so I can utilize all images freely. how to do in asp.net c# <div> <img src="/upload/Tom_Cruise-242x300.jpg" alt="Tom_Cruise-242x300.jpg" align="left" border="0" height="300" width="242"> sample text sample text sample text sample text <img src="http://www.sharicons.com/images/rss_icon.jpg" alt="Icon" align="left" border="0" height="100" width="100"> sample text sample text sample text sample text sample text sample text sample text sample text</div>

Get Youtube Video Feed By Tags With Space In Tags?
stackoverflow.com
To get the feed of a certain uploader with a certain tag I use the following api url: [URL] if I wanted to search i.e. for the feed with tags foo and bar, I would use the following: [URL] BUT since youtube lets you specify tags with space, i.e. "foo bar", I want to search exactly for this tag. So when I use the first URL in combination with urlencode in PHP it won't return anything. In the browser, the URL will change to .../uploads/-/foo%20bar, but also no results. When I use uploads/-/foo/bar, the problem is that it returns videos having the tags 'foo' and 'bar' (wrong), or only 'foo bar' (right). I also tried to replace the space with /, +, and -. Using the keywords.cat scheme in the URL will also return the same results.

How Do I Link Layers Together In CS 2
www.photoshopgurus.com
How do i link layers together in CS 2 Can't find the little boxes i used to use in ver 7

C# - Parse Using Regex Class Of System.Text.RegularExpressions
stackoverflow.com
I have a string which i need to parse using Regex class of System.Text.RegularExpressions. I need to find if the first 2 characters of the string are either "00" or "07" or "16" or "23".

C# - Parse CSS Out From <style> Elements?
stackoverflow.com
tell 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.com
I 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.com
I'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.com
I 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 Projects
stackoverflow.com
I 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 .Net
stackoverflow.com
This 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.

C# - Angle Brackets In Page Head Element?
stackoverflow.com
PHP 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.com
So 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?

Remove Style Tags,css,scripts And Html Tags From Html To Plain Text?
stackoverflow.com
I want regex operation for removing style tags,css,scripts and html tags from html to plain text in asp.net c#...

C# - How To Open A Link In A New Window
stackoverflow.com
I 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.com
I 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'?

C# - How To Open The Download Window When A Dynamically Created Link Is Clicked
stackoverflow.com
i have stored the txtfile in the database.i need to show the txtfile when i clik the link. and this link has to be created dynamically. my code below: aspx code: [code].... i have got the link dynamically, but i did not able to download the txtfile when i clik the link. how to carry out this.

Web Forms :: How To Download The Saved Word Document From Ms Access Database Using C#
forums.asp.net
In my application, getting the word document from users and i saved that doucment in access database. Data type is OLE Object. I want to know how to retrieve the document from db?

C# - How To Create Simple Stacked/segmented Html Bar
stackoverflow.com
Rather 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.com
When 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 File
stackoverflow.com
i 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 Application
stackoverflow.com
I 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# Code
forums.asp.net
How 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 Code
stackoverflow.com
anyone 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.com
i'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 Written
stackoverflow.com
I 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 Purpose
stackoverflow.com
We 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.com
I 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.com
i 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.com
I'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# - Change Rendering Order Of Controls?
stackoverflow.com
I 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 :: Insert Data Using EntityDataSource In FormView - C#
forums.asp.net
I 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.com
We'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.

Localization :: Format Money In Two Formats In C#
forums.asp.net
i want to format money in two formats 1) US dollors like this $126,765 2) is normal only seprate with comma when thousand occurs like this 126,765

C# - How To Get Date And Time Formats Based On Culture Infomation
stackoverflow.com
What 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 ?

Difference Between Asp And C# ?
stackoverflow.com
Are 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.net
I 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.com
I 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# - .Net Equivalent Of JSP Page?
stackoverflow.com
What is the .Net equivalent of a JSP page?

C# - Add Controls Dynamically To Form?
stackoverflow.com
I do not know how to add controls dynamically to the form using c#.net, I know this with vb.net but i need to know the syntax in c#.

C# - Google Page Rank Checking Script?
stackoverflow.com
I am in search of some Asp.Net script by which i can get the google pagerank of any url that i supply to it.

C# - Exception Handling Internal Bug?
stackoverflow.com
Code: 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.com
My 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.

Browser Not Handling Exception From AJAX Panel - C#
stackoverflow.com
i am having trouble catching errors in an AJAX panel. Even when i throw an exception in the c# code behind the front end completely ignores it. Here is the code i have setup, can anyone see why? I ideally want to show a js alert window on error. protected void btnX_Click(object sender, EventArgs e) { throw new ApplicationException("test"); } protected void ScriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) { ScriptManager.AsyncPostBackErrorMessage = e.Exception.Message; } Markup: <script type="text/javascript" language="javascript"> Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); function EndRequestHandler(sender, e) { window.alert(e.get_error().name); } </script> <asp:ScriptManager ID="ScriptManager" runat="server" AllowCustomErrorsRedirect="true" OnAsyncPostBackError="ScriptManager_AsyncPostBackError" />

C# - How To Return A Value Based On The Type Of The Generic T
stackoverflow.com
I 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.com
We 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# - Cannot Implicitly Convert Type System.Collection.Generic.IEnumberable
stackoverflow.com
I'm receiving this error in my Linq statement --- Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'hcgames.ObjectClasses.ShoppingCart.ShoppingCartCartAddon'. An explicit conversion exists (are you missing a cast?) From this query ShoppingCartItems items = Cart.GetAllItems(); ShoppingCartCartAddons addons = Cart.GetAllAddons(); var stuff = from x in items select new ShoppingCartItem() { ProductID = x.ProductID, Quantity = x.Quantity, Name = x.Name, Price = x.Price, Weight = x.Weight, Addons = (from y in addons where y.ShoppingCartItemID == x.ID select y) };

C# - Using Outputcache Together With Urlrewriting
stackoverflow.com
I'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.com
I 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 Webform
stackoverflow.com
i 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# - How To Add The Footer Row Dynamically In Gridview With Textboxes
stackoverflow.com
how to add the footer row dynamically in gridview. with textboxes..

C# - Visual Studio 2010's Silverlight Support ArrayList?
stackoverflow.com
Does Visual Studio 2010's Silverlight support ArrayList? If yes then how to use it, if not then why? How to use ArrayList in Silverlight?

Visual Studio 2010 Express C# Limitations When Develop The Nerddinner Mvc Website
stackoverflow.com
I am trying to develop the nerddinner mvc website, so I downloaded Visual Studio 2010 Express but I do not see an option for MVC or even asp.net website. Can I download this for Visual Studio?

C# - Can Create A PDF Quotation File From Winform
stackoverflow.com
Assuming 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 Browser
stackoverflow.com
In 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.

C# - Improve Design Of GUI / Website
stackoverflow.com
So i am using visual studio 2008, asp.net 3.5, with the basic toolkit provided. Now i have made the gui which a lot of functionality but the design is very basic. nd looks too old. I need to give it a new look, a new feeling new designs. like the gridview, the buttons the textboxes, the menus look basic. this is not working for me. let me how should i go about doing this? 1) i have herd about tool kits but dont kno which ones are good..(dont want the really expensive ones) but if it is really good my company is ready to spend. 2) will the new VS 2010 or asp.net 4.0 make a difference. 3) The ajax toolkit or silverlight toolkit is any good? 4) i also need to show Charts and graphs now, currently using MS charts.. but now i need which is good.

C# - Getting Geographical Coordinates From Web Application?
stackoverflow.com
I want to learn a user's location from his mobile device by web application. When user opens the website, with the help of a script we will learn if the device has a gps hardware.And if the device has gps hardware what are the current coordinates? I'm developing my project using ASP.NET

C# - How To Show / Hide Webforms
stackoverflow.com
Hide/Close Loginform.aspx if userid/password is correct then show newform.aspx and how to create message box on asp?That will pop up Message: Login Successfull. How can i get the username value from loginform.aspx to newforms.aspx so thati can also get its value for my sql queries insert/update.

Find Dimension Of Flash File While Uploading In C#
forums.asp.net
How to find dimension of flash file while uploading swf file just like we do for "jpg" or "gif" file. Anyone having c# version of following code [URL] Or, how to use this code in asp.net 2.0(c#).

C# - Encode Password Field?
stackoverflow.com
I have the following code to encode password feild but it gets error when password feild greater than ten characters. private string base64Encode(string sData) { try [code]...

C# - Copy Several Textboxes Data Into Target Textbox Calling Same Function
stackoverflow.com
I have several input textboxes with different id and class name. I want to track changes in any of the input textboxes, and reflect it into target textbox, but don't want to replicate the function for every individual textbox. Is it possible to use one function for all?

C# - Elmah: Exceptions Without HttpContext?
stackoverflow.com
I spawn a thread on Application_Start and would like to log exceptions. There is not Context/HttpContext/HttpContext.Current, so how might i get it to log?ATM it does not catch any exception in my threads and if i write ErrorSignal.FromCurrentContext().Raise(ex); i get an error about context cannot be null.Maybe i can create a dummy HttpContext but somehow i dont think that will work well.-edit- i tried ErrorSignal.Get(new HttpApplication()).Raise(ex); and it doesnt seem to pick up that exception.

C# - Copying The Entire Telerik Docklayout From One Page To Another Page
stackoverflow.com
I'm trying to copy the docklayout from one page and try to recreate it in another page. Here is my code- protected void dockLayout_SaveDockLayout(object sender, DockLayoutEventArgs e) { List dockState = dockLayout.GetRegisteredDocksState(); JavaScriptSerializer ser = new JavaScriptSerializer(); Session["dock"] = ser.Serialize(dockState); } protected void btnSave_Click(object sender, EventArgs e) { Response.Redirect("receivingPage.aspx"); } receivingPage.aspx.cs public partial class receivingPage : System.Web.UI.Page { private List dockStates; private RadDockLayout dockLayout; protected override void OnInit(EventArgs e) { dockLayout = new RadDockLayout(); dockLayout.LoadDockLayout += new DockLayoutEventHandler(dockLayout_LoadDockLayout); JavaScriptSerializer ser = new JavaScriptSerializer(); dockStates = ser.Deserialize>(Page.Session["dock"].ToString()); for (int i = 0; i < dockStates.Count; i++) { RadDock dock = new RadDock(); dock.ID = string.Format("RadDock{0}", i); dock.ApplyState(dockStates[i]); dockLayout.Controls.Add(dock); } this.Controls.Add(dockLayout); } protected void Page_Load(object sender, EventArgs e) { } void dockLayout_LoadDockLayout(object sender, DockLayoutEventArgs e) { foreach (DockState state in dockStates) { e.Positions[state.UniqueName] = state.DockZoneID; e.Indices[state.UniqueName] = state.Index; } } } But I'm getting emtpy docklayout in receivingPage.aspx.

C# - ELMAH - Only Sending Specific Exception Type Via Mail
stackoverflow.com
I have ELMAH set up for a webapp, logging exceptions to a SQL server. I wish to have ELMAH send me an email too, but only when a specific exception is thrown (ie. MySpecialException). ELMAH must still log all exceptions to SQL server. I know you can do it programmatically in global.asax, but I'd prefer to use web.config. So, how do I restrict ELMAH error mails to filter out everything but a specific exception type, using web.config? UPDATE The filter ended up looking like this: <test> <and> <not> <is-type binding="Exception" type="MyApp.MySpecialException" /> </not> <regex binding="FilterSourceType.Name" pattern="mail" caseSensitive="false"/> </and> </test>

Forms Data Controls :: How To Change The Column's Name Of Dataset Programmatically With C#
forums.asp.net
Base 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 Dataset
stackoverflow.com
I 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.com
i 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?

C# Return Identity After Insert Using SQL DB
bytes.com
I need to know how to return th Id after inserting row, I can do it by many ways, but I need to know why my code doesn't work? [Code]....

C# - Performing Authorisation/authentication Between Webservices?
stackoverflow.com
i am developing webservices.In that i want to maintain state information so that all WebMethods could be access only after Login.I have tried but getting problem.I am attaching my code.Any other alternative will also be welcomed. [ WebService(Namespace = "http://amSubfah.org/")] [ [code]...

C# - Retrieving Keys And NewValues Within A Formview With Manual Data Binding
stackoverflow.com
I have a Formview binded in the code file to a generic list. Now, upon editing of a record, I wish to access the Keys and NewValues out of the FormViewUpdateEventArgs parameter of the ItemUpdating event handler method. From what I've tried and searched over the internet as of now, I've come to know that updated values are only available if the Formview is set a data source control on the markup page else they'd be null. Is this true? Secondly, at this moment I am casting the sender object to formview and individually filling each object property by using FindControl method to find and retrieve values present in the controls. Is this the best way to do this task? As an example, this is what I am doing atm: FormView currentForm = (FormView)sender; ListObject.ID = new Guid(((HiddenField)(currentForm.FindControl("hdnID"))).Value); ListObject.Name = ((TextBox)(currentForm.FindControl("txtName"))).Text;

C# - How To Extend ListItem To Be Able To Have Childs Inside BulletList
stackoverflow.com
Using asp.net C#. I have BulletList, and I would like to add ListItem that will render with childs. That is, inside every <li> I can add more controls to be rendered.

C# - Find Datakeys In Oncheckedchanged Event ?
stackoverflow.com
<asp:Panel ID="pnlFocusAreaPanel" runat="server" GroupingText="Focus Area" Width="800"> <table cellspacing="0" cellpadding="0" width="750"> <tr>[code]... i want to know how i find the datakeyvalue on checked event because updateQuery in checked event is generating exception.

C# - TreeView Control Unexpected Event Behavior?
stackoverflow.com
In the MSDN is writen about TreeNode that: "By default, a node is in selection mode." "To put a node into selection mode, set the node's NavigateUrl property to an empty string." "When a node is in selection mode, use the SelectAction property to specify which event or events are raised when a node is selected." "Setting TreeNodeSelectAction value TreeNodeSelectAction.Select Raises the SelectedNodeChanged event when a node is selected." Here is the problem and possibly a bug in the control: When I set the TreeNode object PopulateOnDemand value to true and call the Collapse() function on that node.Then the TreeNodeExpanded event is raised in addition to the SelectedNodeChanged event.This is in complate contradiction to what is writen in the MSDN.According to the MSDN this sould happen only if TreeNodeSelectAction Property is set to TreeNodeSelectAction.SelectExpand value. Here is the code: <asp:TreeView ID="TreeView1" runat="server" AutoGenerateDataBindings="False" onselectednodechanged="TreeView1_SelectedNodeChanged" ontreenodepopulate="TreeView1_TreeNodePopulate"> [code]...

C# - Receiving System.FormatException After Using ClientScript?
stackoverflow.com
I'm trying to code an onclick behaviour for a GridView by using the following codebehind-code: protected void gridProcesses_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';"; e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';"; e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gridProcesses, "SelectProcess$" + e.Row.Cells[0].Text); [Code]....

C# - Truncate Text In RadGrid Column?
stackoverflow.com
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]...

Security :: C# Active Directory Tutorial?
forums.asp.net
I'm looking for a website or a tutorial of some kind to help me get started on this part of my project.   I need my intranet website to use the already in place active directory.  However, I have never done this before and have no idea where to start.

How To Consume A Atom Feed From Blogspot On C# Website
www.sitepoint.com
I need to consume a atom feed from blogspot on my asp.net C# site. The problem is I am getting this error when trying to load the XmlDocument from the URL: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1. I tried going through a webresponse and replace that byte with string.Empty. But still did not work. The strange thing is I have consumed a atom feed before. Tried using my current code with another atom feed and it works no problem. After trial and error, I found the difference is the working one is contentType text/xml while the wone that does not work is application/atom+xml. If i write out the response from the working one... I see the feed. If I write the response from the non working one, i get jumbled up chars. Like if you open a .exe file in notepad. Funny chars and things. I have tried changing the Encoding, but nothing worked.how do I handle atom feeds with content-type of application/atom+xml?

C# - How To Point URL From Global File Using URL Routing 3.5 Without Parameters
stackoverflow.com
How to point url from Global file using URL routing 3.5 asp.net without parameters? For example: [code]....

C# - How To Get A Null Value From Database To A Checkbox In FormView
stackoverflow.com
i want parse null value and disable checkbox in form view how can i do that that's my current code: <asp:CheckBox ID="FLPCheckBox" runat="server" Text="Full Load Passed" Checked=' <%# (Eval("FullLoadPassed")==DBNull.Value ? false : Eval("FullLoadPassed"))%>' />

C# - Return Different Views In A Controller?
stackoverflow.com
If I have a controller and I want to return a view based on what my conditional logic goes to, is that possible? I have different types of models that i want to insert into a view DEPENDING on my conditional logic (if statements) Can i do this? and how would I do this

C# - Passing JSON Serialized Data Via Hidden Field?
stackoverflow.com
In ASP.NET WebForms I want to pass arbitrary data from server to client and back again. I am serializing to JSON and have been simply producing JavaScript that creates the object on the client. I have no problem sending data to the server with ajax, but there are situations where I also want to send a Javascript object data back to the server on postbacks. So I guess it needs to be in a hidden field. 1) What is the best way to do this in terms of minimizing complexity and optimizing space and efficiency? In researching this I discovered Protocol Buffers but there does not seem to be a good C# implementation. I did find one, but it was a couple years old and self-described as buggy so that scared me. 2) If I just pass a JSON string, how can I be sure it will be safe to include as the value for a hidden field? Is there any reason I might not want to do this? I could Base64 encode, but it seems like this adds a lot of overhead. What is considered the best or preferred method?

C# - Getting Action Filters List From Base Controller?
stackoverflow.com
In Short: Does any know a way from the base controller to get a list of actionFilters being applied to the current executing action? The Long:I am using ASP.NET MVC 1.0 framework. I have a "RequireSSL" actionFilter that I've recreated for checking out, however, if someone leaves the checkout and goes back to the store I would like to forward them back to non-secure version of the site.It would be helpful in the base controller (I am using a custom base controller that inherits from the default Controller) to find out what actionFilters are being applied to the current action.I could include this into the global.asax.cs

Calling A Method From A Cs File?
forums.asp.net
I have a cs file next to the aspx file, I have a method in the cs file and want to call it from the aspx file.. I think it must be easy but I just dont know how to do it ...

C# - Calling Response.TransmitFile() From Static Method
stackoverflow.com
I have a number of pages which need to support exporting data to an Excel spreadsheet. I can generate the Excel files just fine, but I'm trying to work out how to abstract this behavior so it's easily reusable from all of the pages where I need it. My current idea is to use a static utility method, as follows: [Code].... The click handler where I'm calling SendExcelFile looks like this: protected void lnkExport_Click(object sender, EventArgs e) { List<List<string>> dataList = GatherDataForSpreadsheet(); Utility.SendExcelFile(this, "fileNameForDownload.xlsx", dataList, "MyReports"); } This code works just fine as an instance method of the calling page. As a static method, though, it doesn't work at all. When I click the button that invokes this, the browser shows the loading animations indefinitely, but never prompts for a file download. EDIT: If I remove the call to File.Delete() at the end, the method works as expected. Does Response.TransmitFile() do the transfer asynchronously? EDIT 2: I just needed to call Response.Flush() before I deleted the file.

C# - Pass Parameters To Crystal Report?
stackoverflow.com
crystal report has two parameters field, however, i used three method searched, all failed. Error is missing parameter values. sure parameter is passing by query string URL] checked by Label However, do not know why Error is missing parameter values. Method 1 // First parameter ParameterFieldDefinitions crParameterFieldDefinitions; ParameterFieldDefinition crParameterFieldDefinition; ParameterValues crParameterValues = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue(); crParameterDiscreteValue.Value = Request.QueryString["ID"]; crParameterFieldDefinitions = objRpt.DataDefinition.ParameterFields; crParameterFieldDefinition = crParameterFieldDefinitions["Cheque_IssueRecord_Secretary_Review_TT_ID"]; crParameterValues = crParameterFieldDefinition.CurrentValues; crParameterValues.Clear(); crParameterValues.Add(crParameterDiscreteValue); crParameterFieldDefinition.ApplyCurrentValues(crParameterValues); // Second parameter ParameterFieldDefinitions crParameterFieldDefinitions2; ParameterFieldDefinition crParameterFieldDefinition2; ParameterValues crParameterValues2 = new ParameterValues(); ParameterDiscreteValue crParameterDiscreteValue2 = new ParameterDiscreteValue(); crParameterDiscreteValue2.Value = Request.QueryString["tCOMDB"]; crParameterFieldDefinitions2 = objRpt.DataDefinition.ParameterFields; crParameterFieldDefinition2 = crParameterFieldDefinitions2["tCOMDB"]; crParameterValues2 = crParameterFieldDefinition2.CurrentValues; crParameterValues2.Clear(); crParameterValues2.Add(crParameterDiscreteValue2); crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2); Method 2 //objRpt.SetParameterValue("Cheque_IssueRecord_Secretary_Review_TT_ID", Request.QueryString["ID"]); //objRpt.SetParameterValue("tCOMDB", Request.QueryString["tCOMDB"]); Method 3 var value = new ParameterDiscreteValue(); value.Value = Request.QueryString["ID"]; objRpt.ParameterFields["Cheque_IssueRecord_Secretary_Review_TT_ID"].CurrentValues.Add(value); var value2 = new ParameterDiscreteValue(); value2.Value = Request.QueryString["tCOMDB"]; objRpt.ParameterFields["tCOMDB"].CurrentValues.Add(value2); This crystal report database use stored procedure, parameter field is automatically added, after added i removed @ character do not know why parameter missing

C# - What Is Passing Parameters To SQL
stackoverflow.com
In this answer to my question of how to insert data into SQL Server he mentioned passing parameters instead of string concatenation like I currently have. Is this really necessary for security? If so, what exactly is passing parameters? When i google it I get a lot about stored procedures. Is that what I want, I do not know about stored procedures....yet. EDIT: Ok, here is what I got. It seems to update the database correctly and eventually I will change the hard coded ints to inputs from a label. confirm if how I did this is not vulnerable to any sql injection or hacks. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Data; using System.Data.Sql; using System.Data.SqlClient; public partial class Stats : System.Web.UI.Page { public SqlDataReader DataReader; public SqlCommand Command; string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES (@UID, @CL, @LL, @HL);"); //string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES ('a051fc1b-4f51-485b-a07d-0f378528974e', 2, 2, 2);"); protected void Page_Load(object sender, EventArgs e) { LabelUserID.Text = Membership.GetUser().ProviderUserKey.ToString(); } protected void Button1_Click(object sender, EventArgs e) { //connect to database MySqlConnection database = new MySqlConnection(); database.CreateConn(); //create command object Command = new SqlCommand(queryString, database.Connection); //add parameters. used to prevent sql injection Command.Parameters.Add("@UID", SqlDbType.UniqueIdentifier); Command.Parameters["@UID"].Value = Membership.GetUser().ProviderUserKey; Command.Parameters.Add("@CL", SqlDbType.Int); Command.Parameters["@CL"].Value = 9; Command.Parameters.Add("@LL", SqlDbType.Int); Command.Parameters["@LL"].Value = 9; Command.Parameters.Add("@HL", SqlDbType.Int); Command.Parameters["@HL"].Value = 9; Command.ExecuteNonQuery(); } }

C# - Passing Parameters With Conditionally?
stackoverflow.com
i have a dropdownlist with seven different optins like (date, subject, press, cia, media...) and user will select one of the item from the dropdownlist and click on search button to get the results.here is my repository class GetInquires method which accepts 7 parameters but it will pass only one prameters at a time to the storeproc and in case of Date (it will pass both from/to) public List<Inquiry> GetInquiries(string fromDate, string toDate, string subject, string press, string cia, string media, [code]...

C# - Passing Parameters In Windows Service?
stackoverflow.com
I want to develop a windows service which will be accepting a datatable from an aspx page. Both the windows service and the website are hosted on same machine. Also I need to set a date and time on which this service is to work. this date and time are to change according to customer needs. once again the date and time are to be fed from the aspx page.

C# - How To Pass Data To A Custom Error Page
stackoverflow.com
How can I pass some data from a Global.asax event handler to a custom error page in ASP.NET without using Server.Transfer or some redirect?

How To Add Half Of The Div Tag With One Text And Other Half Tag With Marquee Scrolling
forums.asp.net
I have div tag with Marquee.. So I need to add half of the div tag with one text and other half tag with marquee scrolling . Here is my code.. <div><font size="4"><Marquee width="54%" bgcolor="aqua" height="26"><b>Hello Boy....!</b></Marquee></font></div> Now Its doing fyn.. But half div tag or marquee tag I need to add Some text.