asp.net

An exception that cannot be caught?

Hey, I have the following code in my files: In Class Customer.Page: Try If Not SiteContent.CurrentUser(False) Is Nothing Then If Not SiteContent.CurrentUser(False).IsAdministrator OrElse SiteVariables.CustomerMode Then SiteContent.PageViewManager.Create(New List(Of Control)) End If Else Site...

Remain path of FileUpload control after postback....

I have a FileUpload control and a DropDownlist control in an UpdatePanel and when user select a file for the FileUpload control (no upload yet), in the meanwhile the user select an option from the DropDownList control which will cause a postback! Once the page postback, the path selected in the FileUpload control will gone. How can i rem...

pound symbol in plain text email

I am trying to insert a pound symbol into a plain text email using .net but it appears as £ Any ideas how I can fix this? thanks ...

Make ID field invisible in detailsView

Hello, I would like to know how can I easily customize my detailsView that when it is in Create mode ID field should be invisible I can rememebr that it was sth like visible = <% code here ... (IsCreated ??) here is an example: <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="myDS" Width="5...

How to set an empty string as a default value for a DataSource parameter in ASP.NET?

This doesn't work. I've got an exception from SQL databse that column does not allow nulls. <asp:SqlDataSource ID="MyDataSOurcet" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" InsertCommand="INSERT INTO MyTable(Name) VALUES (@Name) WHERE NameID = 1" <InsertParameters> ...

How to minify aspx pages

Hello, I am developing a web-based Pokemon Online game. Since it is online, I would like to optimize it to run as quickly possible. I've installed Firebug and Page Speed suggests minifying my HTML output. I'm also using VS2008, ASP.NET 3.5, AJAX, and IIS 7.5; along with URL-Rewriting. I want to minify my HTML, JavaScript, and CSS. Opti...

Using an IN clause in Vb.net to save something to the database using SQL

Hello, I have a textbox and a button on a form. I wish to run a query (in Vb.Net) that will produce a query with the IN Values. Below is an example of my code myConnection = New SqlConnection("Data Source=sqldb\;Initial Catalog=Rec;Integrated Security=True") myConnection.Open() myCommand = New SqlCommand("UPDATE dbo.Recordings SET S...

how to bind javascript function with OnClientClick event with Eval?

my link button - <asp:LinkButton runat="server" ID="lbtnEdit" Text="edit" OnClientClick="javascript:msgDisp('<%# Eval(LocationId).toString() %>')" /> and the javascript msgDisp is- <script type="text/javascript" language="javascript"> function msgDisp(lid) { alert(lid); } </script> but it is not giiving ...

can I define my own panel control with asp.net usercontrols

I want something like that: <my:MyFancyPanel> <asp:Label Text="Hello"> </my:MyFancyPanel> I tried but it seems my usercontrol doesn't accept any content. ...

What is faster and why?

For maintainability reasons, I want to database drive my javascript, in that I only want to send the javascript which is needed based on the users options. So, is it faster/less resource heavy to have links in the database pointing to javascript files, then using response.writefile to embed those files into the clientside page, or is it...

jQuery call followed by clicking accordion control fires Ms Jscript error

Hi. I have jquery modal that works perfectly fine. But after closing this modal and clicking on accordion control(MS ajax) fires Jscript runtime error Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'AjaxControlToolkit.AccordionSelectedIndexChangeEventArgs' cannot be converted to type 'Sys.Ca...

Deploy ASP.Net website from SVN to multiple server?

I need to deploy a website from the SVN to different servers all within our own network. The code is currently not complied but probably will be in the future. First the site would need to be deployed to the development server for the developers to test. Once the Developer signs off it would be deployed to the staging server for th...

ASP.NET - Tab order not working after ajax postback - Goes to the browser url

Hi Team, I have used Update Panels in my ASP.net webpage. I have a modal popup. But the tab index is set to -1 for all the parent page controls once the modal popup comes in picture. Does anybody has resolution for this. I tried again reseting the tab index through javascript......But its not working(may be DOM is not getting refreshed)...

ASP.net checkbox always checked

<asp:CheckBox ID="isSubscribed" runat="server" /> Subscribe to mailing list?<br /><br /> <asp:Button runat="server" CssClass="btn" ID="btnPrefUpdate" OnClick="updatePrefs" Text="Update" /><br /><br /> This fires in the code behind: protected void updatePrefs(object sender, EventArgs e) { Response.Write(isSubscribed.Checked); R...

dynamic values in kwargs

I have a layer which helps me populating records from the form to tables and viceversa, it does some input checking, etc. Now several methods of this layer which are called several times in different parts of the webform take the same parameters, so I wanted to pack them at the begining of the codefile. kwargs(): return {"tabla"...

ASP.Net. Why am I not seeing my defaultRedirect page even when customErrors mode="On"

Here's the situation: - I have <customErrors mode="On" defaultRedirect="error.html" /> in my web.config. I also have custom error handling code in Application_Error (in global.asax.cs) that checks for certain well known exception types and redirects to custom error pages for each. If the exception is not a well known type th...

C# REST webservice authentication problem

In my previous question here i was experiencing difficulties with Authenticating webservices. With the use of the WcfRestContrib library which i found here i was able to solve this issue. I build a small testapplication and the authentication works like a charm. But while i'm implementing this in the webapplication where i want to use t...

ModalPopupExtender and ConfirmButtonExtender : Postback not firing

I have a ModalPopupExtender and a ConfirmButtonExtender in a user control that is being referenced on a parent page. The parent page performs a partial postback and if a condition is false, I call .Show() on the modal popup. If the user clicks "Yes" I want to fire another event on the parent page. I'm passing delegates to the user cont...

Hosting Web site on cloud service

Right now I am planning to build a news publication website that should be automatically scalable when traffic is increasing. I have good experience in developing web applications using ASP.NET and PHP. To move forward on selection of specific technology here are some questions for which I need some clarifications. My primary intention...

Losing the viewstate

Hello, I'm storing a few of my properties in the viewstate, so I can use them easily on Ajax requests. My property code looks like this: public Language Language { get { return (Language)ViewState["controls_window_Language"]; } set { ViewState["controls_window_Language"] = value; } } However, my customers have reported some e...