asp.net

Javascript Click handler only if ASP.NET client-side validation succeeds

So basically I want to add a javascript function to a button's Click event and I only want it to execute if the form passes ASP.NET client-side validation. The easiest conceptual way I can think of is to just run the validation within my function just return if it doesn't pass, but I'm not sure how to call ASP.NET's validators from ja...

Changing asp:HiddenField.value with JS on ButtonClick

I have four textboxes in my html; one is a serverside asp:textbox and the others are rendered on the client side using dynamic javascript. The javascript creates the textareas; there may be 6, there may be 90. In this example there are 3. <asp:Textbox id="tbxReal" runat="server"/> <asp:button id="btnReal" runat="server" Value="go" /> ...

dataadpter to insert records in existing data table

i am using the following code to insert a datatable to an existing table of database but it's giving exception "Update requires a valid InsertCommand when passed DataRow collection with new rows" where query is select * from placed_student public Boolean insert(string query, DataTable dt) { try { ...

How to make javascript work along with Ajax UpdatePanel

I am trying to add validation on my form. I am using AJAX controls in my form fields. When I remove the Update panel and AJAX control, my validation starts working, but when keeping both the things together, my validation is not working. How could I make them work together? <script type="text/javascript"> function Validate() { ...

How to find object in nHibernate/castle activerecord session

I am getting the following error in an Asp.Net Castle ActiveRecord app when trying to update an object: "a different object with the same identifier value was already associated with the session" I've looked up and down my code to see where else the object might have been created but I'm not seeing it. This is baffling as I have the ex...

find if any checkbox is checked in a specific column of the GridView using jQuery

Hi, Please let me know how to check if any checkbox is checked in a specific column (for example first column) of the GridView control using jQuery? there are checkboxes in other columns too, but I need to check if any checkbox is checked in a specific column. thanks in advance. ...

Migrating from custom user list to MS membership in SQL Server

Hello, Sorry, I'm not even sure how to ask this exactly... but I wrote a website with logins. For that, I made my own users and passwords tables and hashed the passwords myself. Now, I would much rather move to Microsoft's built in membership provider with asp.net in sql server. Does anybody know a good way to migrate over? The only re...

"Parameter is not valid" exception from System.Drawing.Image.FromStream() method

Hi I got a hard time with the Image.FromStream method in my website. The code below works perfect on my computer. But when I uploaded it to the test server, it always gives me "Parameter not valid" exception. if (!afuImageFile.IsUploading && afuImageFile.HasFile) { System.Drawing.Image imgFile = System.Drawing.Image.FromStream(afuI...

How to send a hyperlink using query string method like `www.something.aspx?uniqueid=google+com`?

I want to send hyperlink by attach it with URL with the help of query string method. For instance in a web page containing three links like google.com yahoo.com facbook.com now suppose user click on yahoo.com at this point i want to send it by attaching with url like www.something.aspx?uniqueid=google+com ..........some thing like...

Fluent NHibernate - Collections not filtering

I have a session criteria statement (Fluent NHibernate) that does not seem to filter the child collection even though I have Expressions/Restrictions defined. ICriteria criteria = session.CreateCriteria(typeof(MyClass)); criteria.CreateAlias("MyCollection", "MC"); criteria.Add(Restriction.Eq("MC.Property", value)); IList<MyClass> list =...

Linq to Entities 3.5 where most recent date

I have a table and for the sake of the example lets say it has three columns: Name, DateAdded, Note. In this table there will be multiple records with the same name. I need a linq where clause that will get me a result set with the most recent record for each name. So if I had the following information: Name, DateAdded, Note Alpha, 1/1...

Set textbox visibility based on dropdownlist value in gridview

I have a gridview that i would like to show or hide a text box based on the selected value of a dropdownlist on the same row. My gridview: <asp:GridView ID="GridViewUsers" runat="server" AutoGenerateColumns="False" CssClass="TableFramed"> <Columns> <asp:TemplateField HeaderText="Type"...

How to asynchronously call a web service from an ASP.NET application?

I need to asychronously call a web service from an ASP.NET application. The aspx does not need the answer from the web service. It's just a simple notification. I'm using the ...Async() method from web service stub and <%@Page Async="True" %>. ws.HelloWorldAsync(); My problem: the web page request is waiting for the web service resp...

How can you set the selected item in an ASP.NET dropdown via the display text?

I have an ASP.NET dropdown that I've filled via databinding. I have the text that matches the display text for the listitem I want to be selected. I obviously can't use SelectedText (getter only) and I don't know the index, so I can't use SelectedIndex. I currently am selecting the item by iterating through the entire list, as show below...

how to open file with its application

i want to ask how to open specific file (the file out of the server, i have a relative path to it stored in config file) with its application when click on specific link button or hyper link... like :: open .docx with word. or .pdf with acrobat reader i tried several methods but , i get different errors like "Cannot use a leading .....

Programmatically Set Asp Menu to Selected

I dynamically populate my Asp.Net Menu based on my Database: public class BasicHyperLink { public string Title { get; set; } public string Url { get; set; } } // For example, for the first menu // This is under mnu_DataBound: MenuItem parentItem = mnu.Items[0]; // Get first menu item foreach (BasicHyperLink link in getLinksLis...

Popup with 3 buttons - Onclick event problem AJAX , ASP.net project

Hello For Save button, I have a popup which has 3 buttons inside., Yes, No and Cancel. Yes should call a function and update 2 tables in the database and No should update just one table and cancel should not make any changes in the page. Used code for popup <table id="pnlPopupMerchantUpdate" runat="server" style="dis...

IIS 7 Extremely slow for .aspx pages

I'm running IIS7 on Server 2008 (R1). When I run a completely blank .aspx page, the page still takes more than one second to load, even after compiling and refreshing the browser several times. A non-aspx file, i.e. image or css file takes about 200ms. I've even timed it from the BeginRequest event to the EndRequest event, which rep...

Force asp.net dropdownlist to expand

I have an ASP.NET data bound dropdownlist which is populated based on the contents of a textbox. After it is populated I would like to expand the dropdownlist automatically, so that the user realizes that a choice needs to be made and doesn't need to click on the dropdown to expand it. There doesn't seem to be a property or method do d...

Is it possible to add a Image to the control collection of the header of RadGrid

I would like to add and Image along with the HeaderText in RadGrid. I can able to do this in ItemBound event. But is there any possible ways to do the same in page prerender event? ...