asp.net-3.5

Service AJAX requests with webmethod in ASPX page

家住魔仙堡 提交于 2019-12-21 17:22:49
问题 I am trying to service AJAX requests with a method in my .aspx page. For some reason I am not getting the data returned that I want. Can anybody tell me what I am doing wrong? mypage.aspx: <%@ Page Language="VB" Title="My Page" %> <%@ Import Namespace="System.Web.Services" %> <%@ Import Namespace="System.Collections.Generic" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page

Do a database query on Textbox onblur event

删除回忆录丶 提交于 2019-12-21 12:55:30
问题 I am using asp.net 3.5 with C#. I need to do a database lookup when a user enters ProductID in txtProductID. I guess doing javascript is out of the question since this will have to be server side call. I wrote this code in the page_load event of the webpage: protected void Page_Load(object sender, EventArgs e) { txtProductID.Attributes.Add("onblur", "LookupProduct()"); } protected void LookupProduct() { //Lookup Product information on onBlur event; } I get an error message: Microsoft JScript

Do a database query on Textbox onblur event

爱⌒轻易说出口 提交于 2019-12-21 12:55:13
问题 I am using asp.net 3.5 with C#. I need to do a database lookup when a user enters ProductID in txtProductID. I guess doing javascript is out of the question since this will have to be server side call. I wrote this code in the page_load event of the webpage: protected void Page_Load(object sender, EventArgs e) { txtProductID.Attributes.Add("onblur", "LookupProduct()"); } protected void LookupProduct() { //Lookup Product information on onBlur event; } I get an error message: Microsoft JScript

Cannot access embedded resource in asp.net

假如想象 提交于 2019-12-21 04:52:53
问题 I'm trying to move an image and a style sheet from a user control to embedded resources in the assembly. I have used Reflector to see that the image and .css file are embedded in the assembly, but when I try to access them using the URL created by ClientScript.GetWebResourceUrl(), the resource is not found. I'm stumped. Assembly default namespace: TestWebApp The paths to the files (marked as BuildAction: Embedded Resource) are TestWebApp/Resources/CSS/PaymentHistory.css TestWebApp/Resources

Cannot access embedded resource in asp.net

六眼飞鱼酱① 提交于 2019-12-21 04:52:17
问题 I'm trying to move an image and a style sheet from a user control to embedded resources in the assembly. I have used Reflector to see that the image and .css file are embedded in the assembly, but when I try to access them using the URL created by ClientScript.GetWebResourceUrl(), the resource is not found. I'm stumped. Assembly default namespace: TestWebApp The paths to the files (marked as BuildAction: Embedded Resource) are TestWebApp/Resources/CSS/PaymentHistory.css TestWebApp/Resources

Reading system.net/mailSettings/smtp from Web.config in Medium trust environment

一曲冷凌霜 提交于 2019-12-20 10:25:32
问题 I have some inherited code which stores SMTP server, username, password in the system.net/mailSettings/smtp section of the Web.config. It used to read them like so: Configuration c = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); MailSettingsSectionGroup settings = (MailSettingsSectionGroup)c.GetSectionGroup("system.net/mailSettings"); return settings.Smtp.Network.Host; But this was failing when I had to deploy to a medium trust environment. So

ASP.NET Membership Issues With Registration

丶灬走出姿态 提交于 2019-12-20 05:47:34
问题 I'm having a rough time with this membership stuff. OK, so, it's really odd. I can register a user. I can register, I can login. However, when I go to register ANOTHER user the user isn't saved in the database and I get a Membership credential verification failed event when the user tries to login (I assume because the user is never being saved). Here is the code I am using to save a new user. On the page: protected void btnRegister_Click(object sender, EventArgs e) { if (false ==

jQuery AJAX response always returns nothing

≡放荡痞女 提交于 2019-12-20 05:44:16
问题 The following code returns a blank response no matter whether or not the Function exists, or even the Web Service file entirely: $.ajax({ url: "/ws.asmx/HelloWorld" , type: "POST" , contentType: 'application/json; charset=utf-8' , data: '{ FileName: "' + filename + '" }' , dataType: 'json' , success: function (data) { } }); Why is this? Also, might be worth noting, $.load() works fine! 回答1: Your error is that you try to construct JSON data manually and do this in the wrong way: '{ FileName: "

ASP.NET LinkButton OnClick Event Is Not Working On Home Page

依然范特西╮ 提交于 2019-12-20 03:07:29
问题 I have a user control that handles logging a user in to my site. This user control is placed in the upper right corner of all pages as a Quick Login Box. The problem I'm having is that on my production server, the LinkButton click events I have provided for logging in and reset are not firing the OnClick event after a postback. Its like it just forgets to do it. Normally this wouldn't be such an issue to debug, except that it does not happen when running in debug on localhost (nor when

Need workaround for .Net Master Page Name Mangling

让人想犯罪 __ 提交于 2019-12-20 01:01:56
问题 I'm evaluating converting an old frameset based asp.net website to use master pages. The only thing holding me back is the huge amount of work it will take to update every page to deal with name mangling. Most of my problems are with javascript referencing hardcoded Id's. Is there a way for me to tell ASP.Net that for a particular content area that I don't want mangling to occur. Leave it to me deal with name conflicts. Note I'm aware .Net 4.0 has a solution for this as detailed here. I want