asp.net-4.0

How to Server.Transfer from a standalone page?

元气小坏坏 提交于 2019-12-12 03:48:48
问题 I have a page in a folder on a site, and I want to Server.Transfer to it from the domain root. I tried adding a page to the root containing: Server.Transfer("~/folder1/default.aspx"); But I get a 500 error. I also tried Server.Transfer("/folder1/default.aspx"); With the same result. But when I tried Server.Transfer("default2.aspx"); - another page in the root, it worked. So how do I transfer to the page I want to transfer to? EDIT: folder1 is a web application (Asp.net) - does it matter? 回答1:

Why isn't caching (System.Web.Caching.Cache) used for state management?

丶灬走出姿态 提交于 2019-12-12 03:03:15
问题 I'm trying to understand the accepted answer for Persisting DataSource in GridView after PostBack as I have a similar problem. Quote: I steer clear of putting stuff into the VeiwState or session unnecessarily, so I think the best way to persist this data is to Cache it. When I look at the MS suggestions for state management: ASP.NET State Management Overview caching is no where to be seen. There is a comment (search for Jim_Huff), asking about this, but it isn't answered. Question : What's

pass a textbox value to a label inside a grid view on a button click in asp.net 4 and C#

回眸只為那壹抹淺笑 提交于 2019-12-12 02:16:08
问题 I have 2 asp:panels. One asp:panel contains a textbox and button whose code is as follows <asp:TextBox ID="tbGoal" runat="server" CssClass="textbox" Width="222px" Height="26px"></asp:TextBox><br /> <asp:Button ID="btnUpdate" runat="server" Text="Update Goal" CssClass="button" OnClick="btnUpdate_Click" /> /* **************************************************************************** * CODE BEHIND * ******************************************************************************** */ protected

How to remap all the request to a specific domain to subdirectory in ASP.NET

梦想与她 提交于 2019-12-12 01:38:35
问题 I am using ASP.NET 4.0 (integrated pipeline) with multiple domains in one hosting account. I have my primary domain set up but I want to separate the domains clearly using folder hiearchy. (I have root FTP access, can map all the domains but the master domain to subfolders) I need to map my master domain to a folder too. I'm sure ASP.NET does provide such functionality, probably in web.config settings, but I don't know how to do it. All my searches have led to PHP/Apache settings but I couldn

SignalR fails on IIS

泪湿孤枕 提交于 2019-12-12 01:13:01
问题 SignalR has a nice example for using a Persistent Connection which works just fine when I use IIS Express. It fails when I use the same on the regular IIS that is installed on my Windows 7 system. And it fails silently too, except for the Chrome console telling me: "Failed to load resource: the server responded with a status of 404 (Not Found) ". It is looking for http*:*//localhost:80/echo/negotiate?_=1371821713975 which it can't find for whatever reason. And to make it even more complex:

What's the proper configuration or routing so that Default.aspx, “”, and “~/” don't get routed?

末鹿安然 提交于 2019-12-12 00:52:56
问题 I've got glimpse. it's highlighting an empty line on the routes tab Match Area Url Data constraints DataTokens True Root -- -- Locally it seems cassini doesn't properly emulate a virtual directory so changing from localhost to localhost/site doesn't seem to grant any additional testing insight. Local testing cassini (windows 7 (32 and 64 bit are available)) doesn't seem to use or allow integrated deploy environments IIS7 Integrated Tried a http routing setting to push / to /site however I ran

What happens to an “input” on “submit”? And how can that be done by ASP.Net? [duplicate]

二次信任 提交于 2019-12-11 18:57:34
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Read Post Data submitted to ASP.Net Form I have a google checkout "buy now" button, and am trying to add dynamically created content to send when it's clicked. Using the original html is proving a bit difficult so I want to create an ASP.Net ImageButton Instead of that. I've succeeded in creating the button with the right image, and hooking it up to an event handler in the codebehind. However, I'm not sure what

How do I refer to an html id in code?

末鹿安然 提交于 2019-12-11 18:47:41
问题 I have things like: <form id="Form1"> ... </form> How do I refer to this form in my C# codebehind? I tried simply using "Form1" but it gives me an error. And googling hasn't helped either. What I'm trying to achieve is to enter the item name or one of those fields dynamically on a google checkout "buy now" button. See: How to subscribe to click event of html form?. 回答1: You need to run the form server side: <form id="Form1" runat="server> ... </form> However, if you are using ASP.NET Web

Do a PostBack and add the items server-side for dynamically created checkboxlist item

自闭症网瘾萝莉.ら 提交于 2019-12-11 17:49:29
问题 Its driving me bit crazy on how to do a PostBack for CheckBoxList. I have an autocomplete textbox that triggers the Javascript (on an item selected) by which I'm adding items to checkboxlist dynamically using Javascript appendChild element from the resource: https://stackoverflow.com/a/3184505/1426121 But as told by the user in the answer, the added item disappears the very next moment, for which I have to do a PostBack (suggested by them). Also as in the comment for the answer, I need to

how to omit style sheet to apply style to other web page

拟墨画扇 提交于 2019-12-11 17:39:00
问题 i 'm making one message repeater like new message notification dialogue from this reference http://codepen.io/petebot/full/CpKzI here i just found one new style sheet that gives nice look to message dialogue. but with little restriction i only want to this control style with this style sheet name : <link id="Link2" href="../css/foundation.min.css" rel="stylesheet" type="text/css" target="_self"/> so. i'm making this user control with web user cotrol like this : <%@ Control Language="C#"