asp.net

changing selected text of dropdownlist in Gridview using javascript

I have a dropdownlist, and a Gridview where one of the columns is a dropdownlist. both dropdown lists use the same data source. When a value is selected in the dropdownlist (outside the gridview) I want to chaneg the selectedValue and selectText of every dropdownlist in my gridview. This is what I have tried: Dropdownlist: <asp:Drop...

Asp.net, where to store the username of logged in user?

When a user log into my asp.net site I use the following code: FormsAuthentication.RedirectFromLoginPage(userid, false); As I often need to use the userid I can then later get the userid by: string userid = System.Web.HttpContext.Current.User.Identity.Name; Now I also want to show the logged in username on each page and my question...

Encrypt and Decrypt Image .net

Can anyone give me an example for encrypt and decrypt an image using .net with asp.net I want this encryption to the image when I save it into sql server as binary data. ...

Invalid Viewstate since ASP.NET Oracle Padding Vulnerability Security Patch

Since installing the security patch for the ASP.NET Oracle Padding vunerability any user that was keeping themselves logged in to our site is getting error messages when hitting any page. The errors logged on the server are System.Web.UI.ViewStateException: Invalid viewstate. Client IP: xxx.xxx.xxx.xxx Port: 55796 User-Agent: Mozilla/...

ASP.net iFrame wanna-be

I have been tasked with a project where I am to add a new application and have it within an older application (web applications). This is an internal application and management decided that they want it wrapped in this older app. The older application is a ASP.net web app using the 3.5 framework. My original plan was to use jQuery and...

.NET tracing not working with Diagnostics.TraceSource, only Diagnostics.Trace

I’m trying to set up .NET tracing. I’m able to get basic tracing to work via System.Diagnostics.Trace, but for complicated reasons I have to activate tracing via System.Diagnostics.TraceSource objects (the new way of doing it, since .NET 2.0) rather than using System.Diagnostics.Trace. I've tried everything but it just doesn't want to ...

Windows Authentication to Custom Authentication working with Profile

I Use windows authentication with profile and wanted to flip to a custom authentication. My question is How can I specify that my user is authenticated and how to set the Profile.UserName. I Know the Profile.UserName is ReadOnly . In my Web.Config, i change the authentication mode="None" and configure IIS to enabled Anonymous. In the...

Processing large numbers of emails from an asp.net site

The web site I am developing will be sending tens of thousands of emails daily (and that number will be growing) - registration, notifications, alerts, etc. I will have a dedicated server box that will be actually generating and sending emails by request from the asp.net application (asp.net app calls a WCF method on the email box and pr...

ASP.NET: Call codebehind if javascript doesnt exist in browser,Else javascript function

In asp.net page, How can i call the javascript methods for form processing-submitting if the user browser supports javascript and use code behind events if the browser does not support javascript.I have the javascript code to send the form data to an ajax server page using jquery. Don't know how to invoke the needed one based on the brow...

ASP.net membership add custom column

In my master page I have: MembershipUser thisUser = Membership.GetUser(); loggedInUserID = thisUser.ProviderUserKey.ToString(); thisUser gives me access to all the fields in aspnet_Membership. I want a new field, isSubscribed for each user. I can use an SQL query to fetch the value fine, but I want to know if there is someway to mod...

change the url of redirection of a dropdown with auto postback

Hi!! I have an .aspx page named PropertyListNew.aspx which it's url is rewriten like this: <if url="/Propiedades/(.+)/([0-9]+)"> <rewrite to="/propertyListNew.aspx?currentPage=$2" /> </if> the thing is: I have an asp:DropDownList inside my page (with current url "/Propiedades/(.+)") with autopostbak=true and when that dropdown...

ASP.NET Problem with Redirects

I have a login page which has two options "login as guest" , "login". Each click event will take the user to the same page. However, if login as guest is clicked then i want to be able to change what info is displayed on the page the user is being redirected to. I do not want to use a session variable. Any thoughts on how to do this?...

Call Particular Web farm

Some background. Currently have an asp.net web site which is contained on 2 web servers which are load balanced i.e. web farm. I would like to have some code which would allow me to call a particular server and execute a method on it. I WANT TO do this so that i can force all web servers to refresh their cache via a web page on the sit...

Validation does not work for web usercontrol

I have the following textbox with validation: <asp:TextBox ID="txtInput" runat="server" Width="80px" CausesValidation="True"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredValidator" runat="server" ControlToValidate="txtInput" Display="None" ...

what features or tasks in Visual Studio require administrative permissions?

There is a debate going in our department to remove local admin rights to the development workstations we use. I believe this will cause problems for the developers when trying to debug or run other tasks in Visual Studio but I can't put my finger on any one thing to support my argument. What features or tasks require Visual Studio to r...

Centralized ASP.NET error handling: <customErrors> vs. Application_Error. Is it possible to use both?

Currently, we are doing error handling via Application_Error in global.asax.vb: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) OurLibrary.HandleError(Me) End Sub HandleError then logs the error into a database, displays an informative message to the user and returns the correct status code (404 or 500) dependi...

Is it possible to have area routes co-exist with non-area routes at the same time?

I have an existing project, and I want to intorduce Areas and keep my original code as it is. i.e /web/controllers /web/views .. /web/areas/new-area/ /web/areas/new-area/controllers .. Do I have to modify routing for this to work? i.e. default area is ""? ...

VB.NET QueryString

I am using Datagride and I have a I have passed some parameters in it the code is as follow: <asp:TemplateField HeaderText="Download"> <ItemTemplate> <asp:LinkButton ID="lnkname" runat="server" Text="Download" PostBackUrl='<%#"~/logout.aspx?ID="+Eval("ID")+"&category=mobile"%>'></asp:LinkButton> ...

Getting Eval to work in a databound, templated custom control

Context I'm putting together a templated, databound control. Presently it works with the following syntax... <cc:ItemChooserControl ID="ItemChooser" runat="server"> <TitleTemplate> <h4><%# DataBinder.Eval(Container.DataItem, "DisplayName") %></h4> </TitleTemplate> </cc:ItemChooserControl> Problem What I would like t...

Using an ObjectDataSource with a GridView in a dynamic scenario

I have a search page that is tasked with searching 3.5 million records for individuals based on their name, customer ID, address, etc. The queries range from complex to simple. Currently, this code relies on a SqlDataSource and a GridView. When a user types a serach term in and presses enter, the TextBoxChanged even runs a Search(ter...