webforms

Gridview Hyperlinkfield using DataNavigateUrlFormatString with Ampersand

て烟熏妆下的殇ゞ 提交于 2021-02-05 06:50:05
问题 So I have gridview pulling fields from a table and my hyperlinkfield is used to go to a specific page for that row to get more detailed data. Everything seems to work great except when the field used in the hyperlinkfield has an ampersand. I assume it is reading the ampersand as something else and so it doesn't bring up the proper info because the ampersand is in the name in the database. Hyperlinkfieldcode: <asp:HyperLinkField HeaderText="Name" Text="{0}" DataNavigateUrlFields="Name"

Gridview Hyperlinkfield using DataNavigateUrlFormatString with Ampersand

老子叫甜甜 提交于 2021-02-05 06:49:07
问题 So I have gridview pulling fields from a table and my hyperlinkfield is used to go to a specific page for that row to get more detailed data. Everything seems to work great except when the field used in the hyperlinkfield has an ampersand. I assume it is reading the ampersand as something else and so it doesn't bring up the proper info because the ampersand is in the name in the database. Hyperlinkfieldcode: <asp:HyperLinkField HeaderText="Name" Text="{0}" DataNavigateUrlFields="Name"

How to view entire call stack hierarchy without breakpoints? (Visual Studio 2015 + ASP.NET Web Forms)

戏子无情 提交于 2021-01-29 18:52:00
问题 I want to figure out what methods are being called in what order when I build and run an ASP.NET web form application. The context is that I'm trying to decipher the architecture of the code base I'm working on, and its not clear where the program begins. Using breakpoints randomly has been helpful but does not give the entire picture. Is something like this possible? 回答1: You can use my Runtime Flow extension to view entire method calls hierarchy of an ASP.NET applicaton. 来源: https:/

Downloading a file with webforms and EPPlus

与世无争的帅哥 提交于 2021-01-29 13:35:54
问题 I am implementing a small export feature for a legacy webforms application. My export code right now is only headers (just testing the that I can successfully create a file): public MemoryStream Export() { var result = new MemoryStream(); using (var p = new ExcelPackage()) { var ws = p.Workbook.Worksheets.Add("Contacts"); var col = 1; ws.Cells[1, col++].Value = "ID"; ws.Cells[1, col++].Value = "First Name"; ws.Cells[1, col++].Value = "Last Name"; ws.Cells[1, col++].Value = "Email"; ws.Cells[1

Remembering Session in iframe with ASP.NET WebForms

痴心易碎 提交于 2021-01-29 09:38:46
问题 Strange behavior occured in an old WebForms app. I can't give you link, or big picture, I can only ask for specific detail, so maybe someone has an idea which way to explore. App on the domain A embeds app on another domain B within iframe. (If it hosts the site on the same domain, then it's fine, the problem doesn't occur.) domainA.com: <iframe src="http://domainB.com/page1.aspx" /> page1.aspx writes a Session variable: http://domainB.com/page1.aspx: HttpContext.Current.Session["UTCOffset"]

Dynamics NAV Web Service Call with C# succeeds after 401 errors

孤者浪人 提交于 2021-01-29 09:13:20
问题 I'm experiencing some odd behaviour (meaning I don't understand what's happening) and I'd like some help fixing it if possible. We have some Dynamics 365 NAV Business Central web services exposed an secure with an SSL ceritificate, which we're accessing using some standard C# code. We've added the SOAP proxy to an ASP .NET Webforms application and this is all working as expected. We then declare an instance of the web service, set the credentials using a new NetworkCredential instance, and

How to execute javascript function from code-behind but only after the page loads

£可爱£侵袭症+ 提交于 2021-01-29 03:30:34
问题 I've found other solution on how to executes a javascript function from code-behind. The problem is that it firing before the page loads, so I can't add logic to it. if(result) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Script", "confirmPwdChange();", true); } On the client side <script> confirmPwdChange() { alert("Password has been successfully changed."); //Add more logic here, after user clicks the OK button... } </script> No Jquery, if possible. Thanks for helping. 回答1:

ASP.NET web forms Login control SQL Server data binding?

故事扮演 提交于 2021-01-28 21:37:59
问题 I'm trying build web form with login control. Normally when you drag and drop Login control on aspx form, Visual Studio creates ASPNETDB.MDF database in App_Data folder. In my case it didn't create. So I've created ASPNETDB database within my SQL server using aspnet_regsql tool. Also I have Sql Connection String ("myCS") in web.config file, which connected to my ASPNETDB database in SQL server: <add name="myCS" connectionString="Server=myserver; Database=ASPNETDB; Persist Security Info=True

Extract Sustainsys SAML 2.0 Assertion

会有一股神秘感。 提交于 2021-01-28 14:13:27
问题 I am tasked with setting up SAML 2.0 Single Sign On via the Sustainsys (Kentor) library for the project I am currently working on. Here is the documentation I have been following. The website is a webforms application so I am using the HTTPModule portion of the Sustainsys library. I have configured my IDP (Okta) to send the SAML 2.0 assertions to the website which the documentation proclaims the Endpoint to be /Saml or /Saml/Acs . The site is a Kentico CMS website and the CMS offers an API

Delete temp files on Session end in ASP.NET

巧了我就是萌 提交于 2021-01-28 07:06:08
问题 My website creates a bunch of png files while converting documents from pdf. I have all those files uniquely identified and I want them to be removed at session end. My idea was to create a List, store it in Session and delete each file by path stored in my List<>. In Global.asax I added: void Session_End(object sender, EventArgs e) { if (Session["cleanUpCollection"] != null) { List<String> deletePaths = ((List<string>)(Session["cleanUpCollection"])); foreach(String s in deletePaths) { try {