webforms

jQuery PageMethods 401 Authentication failed with FriendlyUrls

折月煮酒 提交于 2020-02-05 04:06:40
问题 I have FriendlyUrls nuget package added to WebForm application. In RegisterRoutes I have: var settings = new FriendlyUrlSettings(); //settings.AutoRedirectMode = RedirectMode.Off; settings.AutoRedirectMode = RedirectMode.Permanent; routes.EnableFriendlyUrls(settings); I created 2 pages WebForm1.aspx and WebForm2.aspx On WebForm1.aspx I referenced jQuery v1.9.1 in the head simply added the following inside the default div tag in the body: <div id="dvResult"></div> <script type="text/javascript

How to clear all form fields from code-behind?

三世轮回 提交于 2020-01-29 05:24:05
问题 HTML has an input button type to reset all fields in a form to their initial state in one step: <input type="reset" ... /> . Is there a similar simple way to reset all form fields of an aspx page from code-behind? Or is it necessary to reset all controls one by one with TextBox1.Text=string.Empty , TextBox2.Text=string.Empty , etc. ? Thanks in advance! Update: Context is a simple Contact/"Send us a message" page with 8 asp:TextBoxes on the page (where the user enters the name, address, phone,

How can I connect up my UserControl properties in such a way that they retain state on postback?

做~自己de王妃 提交于 2020-01-25 07:16:23
问题 In an ASP.NET Webforms application I have a submission form containing a UserControl with properties as such: public string Name { get { String s = (String)ViewState["Name"]; return ((s == null) ? String.Empty : s); } set { ViewState["Name"] = value; } } This is adapted from an MSDN walk-through. This is assumed to be "bound" (not databinding as I don't think that's possible) to the contents of a text box defined in the ascx as below: <asp:TextBox runat="server" ID="name" /> The question is,

How can I connect up my UserControl properties in such a way that they retain state on postback?

会有一股神秘感。 提交于 2020-01-25 07:15:45
问题 In an ASP.NET Webforms application I have a submission form containing a UserControl with properties as such: public string Name { get { String s = (String)ViewState["Name"]; return ((s == null) ? String.Empty : s); } set { ViewState["Name"] = value; } } This is adapted from an MSDN walk-through. This is assumed to be "bound" (not databinding as I don't think that's possible) to the contents of a text box defined in the ascx as below: <asp:TextBox runat="server" ID="name" /> The question is,

Submit, Show Results, delay 3 seconds and redirect

喜欢而已 提交于 2020-01-24 06:08:11
问题 I've got a form where users can input data and the behavior that I'm looking for is after the submit, the code behind writes to a database and returns a response of success to the page. I currently have this code working. The next item that I'd like to have happen is redirect after the successful message but I'd like to delay for 2 or 3 seconds allowing the user to see the success message before redirecting. Behavior: Submit -> Show Success Message -> Delay 3 seconds -> Redirect I'm currently

Submit, Show Results, delay 3 seconds and redirect

。_饼干妹妹 提交于 2020-01-24 06:06:54
问题 I've got a form where users can input data and the behavior that I'm looking for is after the submit, the code behind writes to a database and returns a response of success to the page. I currently have this code working. The next item that I'd like to have happen is redirect after the successful message but I'd like to delay for 2 or 3 seconds allowing the user to see the success message before redirecting. Behavior: Submit -> Show Success Message -> Delay 3 seconds -> Redirect I'm currently

Submit, Show Results, delay 3 seconds and redirect

雨燕双飞 提交于 2020-01-24 06:06:40
问题 I've got a form where users can input data and the behavior that I'm looking for is after the submit, the code behind writes to a database and returns a response of success to the page. I currently have this code working. The next item that I'd like to have happen is redirect after the successful message but I'd like to delay for 2 or 3 seconds allowing the user to see the success message before redirecting. Behavior: Submit -> Show Success Message -> Delay 3 seconds -> Redirect I'm currently

ASP.NET AutoPostBack and then Back Button weird occurrence

核能气质少年 提交于 2020-01-23 19:24:32
问题 To keep this simple, I have a dropdownlist and a button in an ASP.NET form. The dropdownlist has an autopostback function that calls DropDownList1_SelectedIndexChanged and the page is redirected somewhere (for this example www.google.com) and the button has an onclick that goes to Button1_Click1 and the page gets redirected to www.yahoo.com. The Problem: If I click the button, I go to Yahoo, which is what you'd expect. If I click back button in my browser and select the dropdownlist I go to

Selenium Form Submission

旧巷老猫 提交于 2020-01-23 12:35:47
问题 I am trying to automate a form submission using selenium. But JavaScript that runs upon clicking sign-on is causing Exception invoking submit. Selenium is directing the submit to localhost, not to the form action. Can anyone explain why is this happening and kindly provide a solution on how to overcome this. Here is the form : <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <title>Sign On</title> <base href="https://machine.place.domain.com:9031/"/> <meta http-equiv="Content-Type" content=

MVC or Web Forms? [closed]

蓝咒 提交于 2020-01-23 12:33:50
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I a general question. When i want to develop some new web project (not simple page-something bigger and quite complex) what technology