Click here to Skip to main content
15,892,059 members
Everything / WebForms

WebForms

WebForms

Great Reads

by Altaf Ansari
SignalR Real-Time ChatApp with Emoji / Smiley and sending file attachment
by Altaf Ansari
Integration of SignalR with ASP.NET C# WebForm Application in Real-Time Chat Application
by Vahid_N
PdfReport is a code-first reporting engine which is built on top of the iTextSharp and EPPlus libraries.
by pmpdesign
A lightweight C# library to add images and 'round rectangles' to a PDF on the fly and then securely embed the PDF in a web page

Latest Articles

by adriancs
Generate PDF from HTML with MS Edge
by adriancs
Easily route all pages at once in single line.
by gggustafson
This article revises an earlier revision of the Gradient Color Picker (V2). The incentive for the revision was a reader request for a larger number of initial color choices.
by gggustafson
Revises an earlier implementation of the Gradient Color Picker

All Articles

Sort by Updated

WebForms 

N 5 May 2024 by Nishantsk
You can manage lots of overlapping controls in Visual Studio by putting every group into its own UserControl. On your MainForm, you stack all these UserControls above each other. So at the MainForm, you can’t get a good overview, but now you have...
N 29 Apr 2024 by Rama2F
I'm trying to create a Web Form using [ASP.NET Web Forms Site] template, Visual Studio 2022, but I'm facing problems with the controls. Adding labels is fine but, the moment I add a textbox, followed by a button, they overlap and become...
10 Apr 2024 by Graeme_Grant
Quote: When Manager clicks either of the link, it hits the endpoint and their response is Captured in Database. To prevent sharing, the only option is for the intended recipient to log back in, then you verify both the account used to sign in...
10 Apr 2024 by Pete O'Hanlon
I'm afraid you need to go back to whoever gave you the requirements and explain this is a monumentally bad idea, and also impossible to implement. If one manager forwards it to another, you can't prevent that, and you can't change the contents of...
10 Apr 2024 by Vaithilingam Alagappan
When User raise a request for Access. User's Manager needs to approve the request through email. The email will have Approve and Reject link as API endpoint URL. i.e., Approve - https://example.com/api/approve, Reject -...
9 Apr 2024 by Pete O'Hanlon
You probably want to start by reading and implementing authentication using Use ASP.NET forms-based authentication - ASP.NET | Microsoft Learn[^]. To control access to web pages, and folders of pages, use Control authorization permissions in...
8 Apr 2024 by Member 16239575
Hello, I want to do user-based page authorization with asp.net web forms. What I want to do is to take the role of the user while logging in from the users table in the database and control which pages he can access there, for example, let the...
1 Feb 2024 by cheesecake 2
I cannot understand how to connect this to the database. and if I want to convert this project into mvc how to do it. I am new to Asp.net and willing to learn this. please help. what are the good frontend languages for asp.net or usually we use...
1 Feb 2024 by M Imran Ansari
Refer to the article below to initiate your learning process. The Note section contains some valuable links that can be really helpful for your understanding as a beginner. Beginner's Guide for Designing ASP.NET MVC Applications using SQL Server...
23 Dec 2023 by 2techbrothers development
After installing Microsoft.AspNet.FriendlyUrls to hide .aspx from URL, The website is showing 500 internal server error only on mobile devices, but it works fine on the desktop. Code in RouteConfig.cs using System; using...
8 Nov 2023 by Richard Deeming
That exception is nothing to do with reCAPTCHA; it's a network error in the communication between your web server and your SMTP server. It's a generic error, with many possible causes - eg, running out of available sockets; software on the web...
8 Nov 2023 by Member 12055655
I have never implemented Google Captcha before, so I am unaware of what the problem is. When I submit the form, sometimes it works and sometimes it doesn't. If I submit the form without checking the captcha box and then click the captcha box when...
25 Oct 2023 by ashwini gaikwad 2021
I have 1 grid in ASP.NET and I am trying to fetch the data when I click any row to update or delete, but the event is not getting called when I click on grid row. What I have tried: protected void GridView1_SelectedIndexChanged(object sender,...
16 Oct 2023 by Richard Deeming
You haven't provided any way for the user to select a row. Therefore, the "selected row changed" event is never going to fire! Either set the AutoGenerateSelectButton[^] property to true, or add a CommandField[^] to the grid with the...
16 Oct 2023 by M Imran Ansari
Your code seems good but you can verify the following points: 1. If your GridView is placed inside an UpdatePanel, ensure that the GridView is configured as a PostBack trigger for that UpdatePanel. This is important for Ajax-enabled pages. 2. If...
13 Sep 2023 by pankajgarg1986
I am using iTextSharp PDF library to convert plain html into multiple pages PDF file. The problem is with printing footer on every page. I have tried everything, but nothing worked. Please help me to sort out this issue. Below is my complete...
16 Jul 2023 by kidmacsin
I lost my .aspx.cs file containing the codebehind my aspx files of webpage. Is there anyway I can recover the codebehind of my aspx file already compiled and hosted?What I have tried:I tried opening the file in Web Developer, MS Visual Code and notepad. But unable to find the inline...
3 Jun 2023 by Rafael Falagan
Hello: I'm trying to convert an existing integration to UPS web services to the new Web API using OAuth 2.0 security model. I would like to be able to pick up as much logic as possible from the current implementation using web services. Not...
23 May 2023 by Fydobas
I have successfully implemented authentication via Azure on my ASP.Net Web Forms website/application using the OWIN module. However, when I try to get the authenticated user's identity, it seems to display/return an empty string Here is my...
23 May 2023 by Fydobas
I don't know what the root cause of the problem was, but I've figured out an alternative way: using the Claims object exposed by OWIN to get the username. If HttpContext.Current.GetOwinContext().Authentication.User.Identity.IsAuthenticated =...
23 May 2023 by Andre Oosthuizen
Microsoft docs and using Owin suggest to check some of the following, I trust the answer might lie in here - 1. Check that the necessary NuGet packages are installed correctly and is available for OWIN and Azure AD authentication. 2. Check the...
7 May 2023 by Member 15990780
Working with upload function, using FileUpload Control and I'm trying to cleanse some data to avoid the duplication by using replace/ update the existing file by scanning the datetag, dateuntag, tag and tagtype to replace/ update the entire row...
28 Apr 2023 by Member 15990780
I'm trying to work with uploading excel in asp.net c# web form and save in sql however it also upload duplicate data in row. private bool uploadfile1() { try { if (FileUpload1.PostedFile.FileName != "" || FileUpload1.PostedFile.FileName !=...
27 Apr 2023 by OriginalGriff
Two ways to avoid duplicates: 1) Check first to see if the row exists, and if it does, don't INSERT 2) Try to do an UPDATE and see if the "rows affected" count is zero. If it is, there was no such row and it's safe to INSERT. If it is non-zero,...
24 Apr 2023 by Santiago Fabian
Hi,I want to show the content of any external www.xyz.com website in my web project that is built using ASP.NET/C#.- so far I have tried the HTML iframe tag and this does not display...
15 Apr 2023 by Graeme_Grant
I mentioned above that you should use IHttpFactory. Here is a minimal implementation (.Net 3.1+): IHttpClientFactory InitializeHttpClientFactory() { ServiceCollection builder = new(); builder.AddHttpClient(); ServiceProvider...
15 Apr 2023 by Ahmad Yousef 2021
I'm posting to web API, but it keeps loading the page without any response... What I have tried: First I tried this code after putting my url, email, key and service: public async Task Login() { using (var client...
14 Apr 2023 by Pete O'Hanlon
The two pieces of code you show are not equivalent. In the first instance, you pass the parameters as a post body. In the second instance, you add them as headers to a GET request. Which is it? Are they headers on a get or are they a post body?...
13 Apr 2023 by mtoha
try to use this functions: public async Task ConnectHttpClient(string apiUrl, R reqModel) { M model = default(M); HttpClient client = new HttpClient(); client.BaseAddress = new Uri(baseUrl); ...
16 Mar 2023 by Member 14760154
I Have a Problem with my project , I was create 2 dropdownlist ,which value of a dropdownlist set by selected value of another dropdownlist , I wish, when i selected a value in dropdownlist1 ,value of dropdownlist2 would be changed how i...
16 Mar 2023 by DREAM BOY SUBODHA
Checkbox checked then will show check box list
23 Feb 2023 by Koppula Ravi
- All the projects are in asp.net web forms using donet framework 4.7.2. - I have 40 over projects with the same project configurations ( All are web forms and framework is 4.7.2). - I have created a folder named 'Assets' and kept all my CSS...
23 Feb 2023 by mtoha
I guess you need 1 project containing assets, that method is like CDN method. And then the project calling .js .css .jpg and all things using that project.. i.e. http://project-assets/css/site.css At iis you should filter that extensions is...
20 Feb 2023 by Richard MacCutchan
You can put the actual folder anywhere, a reasonable place would be a folder above all the project folders. You can then add references to it in each project that needs it; something like: Dev +--Assets +--Project1 -- include ..\Assets\... ...
13 Feb 2023 by Andre Oosthuizen
As per your link, a reference to ensuring the path is correct to your ADFS server - The path to the ADFS XML metadata is always your ADFS server FQDN, followed by a path to the FederationMetadata XML document To solve your problem, check...
13 Feb 2023 by $ultaNn
Dear i ave followed steps given in this Link when I debug the application, I am getting Error This site can’t be reached What I have tried:
9 Feb 2023 by Muthu vj
Hi, is it possible to add xslx format in report viewer. What I have tried: is it possible to add xslx format in report viewer.
9 Feb 2023 by Andre Oosthuizen
From the little info you provided, yes you can. When specifying what you want your output to be, instead of sending WORD and EXCEL as the parameters for the output, send WORDOPENXML and EXCELOPENXML. To verify what output your version of...
29 Jan 2023 by G.Mariappan(a)Murugan
Hi All,I created a webservice in VS2010 and run in local host it displays in right format is shown below.How are you Mariappan Ganapathybut in other Machine it shows as the xml file does not appear...
29 Jan 2023 by peterwuzere
I have the same problem. i downloaded the messageboard app from this site and tried the RSS link. In the FeedService class file their is the following code: Dim feed As SyndicationFeed = New SyndicationFeed("Message Board", "A sample message...
29 Jan 2023 by kk2014
Hi All suppose i have two sites are https://test.com and http://test.com. Earlier, my files were on http://test.com (non-secure) now i have migrated them on https://test.com (secure). So now there are no files on http://test.com (non-secure). ...
19 Jan 2023 by Kishor-KW
in my asp.net web-form project there is .cs file (code file) where i did database related connections and CRUD operation. Now I want to handle a exception if occurred, I used try catch block. When exception occurred it will be thrown but I want to show message to a user that perticulare...
15 Jan 2023 by Shubhangi Dhole
I have a grid, which contains a text box. By default, the grid contains 10 rows. When I click on add new row button on footer template , the entered previous details will be cleared off. Please give me the solution so that the previous details are not cleared on the button click. What I have...
15 Jan 2023 by Pejman Paknia 2023
use type button , the default is submit and it posts the form like this:
1 Dec 2022 by adriancs
Generate PDF from HTML with MS Edge
29 Nov 2022 by Member 11072304
how to use anti forgery token in asp.net web forms and angularjs. I am making call to aspx WebMethods through angularjs http service and I'm not using web form or server side controls to submit form What I have tried: I tried to find but I...
29 Nov 2022 by Richard MacCutchan
anti forgery token in asp.net - Google Search[^]
21 Nov 2022 by DerekT-P
Some years ago I wrote a LoB application for a client. It uses ASP.Net Framework 4.x with WebForms. It's feature-rich, robust, and the client is now reliant on it. It's a multi-layer app with separate Data Access, Business, and Presentation...
21 Nov 2022 by Richard Deeming
Microsoft is working on a tool to assist with incremental migration from ASP.NET to ASP.NET Core: Migrating from ASP.NET to ASP.NET Core in Visual Studio[^] However, WebForms is currently not "supported". I haven't tried the tool, so I don't...
20 Nov 2022 by Graeme_Grant
There is no easy bullet to migration, but there is plenty of advice on the internet. Here is a google search: webform to mvc migration - Google Search[^] Here are a couple of results from that search: * ASP.NET - Migrating ASP.NET Web Forms to...
13 Nov 2022 by adriancs
Easily route all pages at once in single line.
13 Oct 2022 by MHD Salim Al-Tarsha
I Apologize for my English I'm having a bit of a problem calling an Ajax function to insert new data to SQL database and then return the primary key of the inserted data ... Data is being inserted successfully but no primary is being returned !!!...
13 Oct 2022 by George Swan
In your ajax method remove the line dataType:"json" The success function is not called if this is set
1 Aug 2022 by Member 8583441
I am having two textbox having ajax calendar for both. In this the Ajax calendar is set for selecting months not the dates that was successful. Now I don't want to select the previous months and future months and reflect in the textbox. I was...
6 Jul 2022 by itsathere
Hi, I am using asp.net web from and creating dynamic controls using javascript but not able to find control using their name. What I have tried: var files = Request.Files; List Settlement_Offer_Details...
23 Jun 2022 by Alaren
I have a webforms asp.net website which is using the standard menu control. we have a page that contains a html5 drawing canvas which is for gojs charting. When the menu expands, it seems to appear in front of the canvas itself, but behind any...
23 Jun 2022 by Alaren
Aha, found it, the menu needed to have the postition:relative added to make the z-index work.
8 May 2022 by Ausquito games
Olá pessoal, estou precisando da ajuda de vocês. Tenho uma página asp.net(webforms) com os seguintes controles: 1 TabContainer e 4 TabPanel Quote: Hi guys, I need your help. I have an asp.net(webforms) page with the following controls: 1...
12 Apr 2022 by Christopher Fernandes
I have an ASP.Net Web Forms project under which the BO, BL, DA class files are stored in the App_Code folder. I just recently added 3 class libraries to the project namely(projectBO, projectBL, projectDA) I use VisualSVN for version control with...
12 Apr 2022 by Christopher Fernandes
I have a ASP.net Web Forms Application using .net framework v4.0 hosted on the intranet of my organisation Recently the app stopped sending emails here is the code public void SendMail(string host, string userid, string password, string...
12 Apr 2022 by Christopher Fernandes
Just changed the .Net Framework to v4.8 and it got fixed.
3 Feb 2022 by Member 14760154
I have a issue in my project , I wanto to create a pagination for my gridview form , i have found some resources ,i try it, it was success ,but not successfully at all , it just find data in that page ,cannot load data in the next page , (this...
3 Feb 2022 by Shivachalappa Gotur
Its very easy . I m giving a link for example of Datatable implementation in asp.net with search, pagination, sorting functionality. Have look at it. Display Data In ASP.NET Using jQuery DataTables Plugin[^]
31 Jan 2022 by Sanjeev236
I am developing a blog Website in asp.net c# Webform(https://[DELETED].in). I am using using System.Web.Routing & Microsoft.AspNet.FriendlyUrls for routing in webform; Route.Config is as follows: var settings = new FriendlyUrlSettings(); settings.AutoRedirectMode =...
31 Jan 2022 by Jamil Hallal
I would suggest to use URL Rewrite in IIS, this can be done in the web.config
19 Jan 2022 by Tinsae Teku
Let me explain my issue using a simple example: I have a table with attributes 'id' , 'age', 'sex' and 'grade'. Then I have many student's data list. I have already managed to insert specific data (For example: '0001', '12', 'male' and 'B+') into...
19 Jan 2022 by _Asif_
Its not that difficult. Approach could be like * HashMap filterMaps = new HashMap() * for each column (Id, Age, sex, group, etc) filterMap["Id"] = 001 filterMap["Age"] = 12 * ArrayList list = new...
19 Jan 2022 by OriginalGriff
Build it up as a string collection: each attribute calls a method which appends to a List if the associated check is ticked. When you've assembled them all, use string.Join[^] to combine them: string sql = $"SELECT * FROM MyTable WHERE...
19 Jan 2022 by CHill60
Simplest approach - Use the concept of repeated filtering if(age == 12) { if(gender == "male") { if(grade == 2) { ... } } } You will only have as many ifs as you have attributes
9 Jan 2022 by Palash Sachan
How do i remove this blank space from gridview in asp.net? please see this IMAGE I want to remove this blank white space NOT hide this(as I know we can hide this border very easily) even after hiding the border the white unused space is there i want to remove that please see this IMAGE my...
9 Jan 2022 by Hasan Turer
Try this. Deleting or editing before binding to datatable is easier and more secure I think. public static void RemoveEmptyDataTable(DataTable dt) { for (int i = dt.Rows.Count - 1; i >= 0; i--) { ...
29 Dec 2021 by Member 15483157
CodeProject - For those who code[^]
29 Dec 2021 by Member 12433411
I have created a Web API and I need to use the "Get" service in an asp web form in a Grid View, how could I do this?What I have tried:I have created a Web API and I need to use the "Get" service in an asp web form in a Grid View, how could I do this?
8 Dec 2021 by Member 14223731
I started a new web Application Project in visual studio to use it to connects to a specific HTTPS WebService to get data from database, I click on to add a web reference In the solution explorer and when I type the URL and try validate it I get...
8 Dec 2021 by thatraja
Self explanatory. You need access so check with particular Webservice's owner. FYI How to Fix a 403 Forbidden Error[^]
21 Nov 2021 by Member 14938962
I have been struggling at this for weeks. I have built a ASP.NET Web forms application and it is being audited for vulnerabilities. Burp tool is being used for testing and it is able to intercept and edit the textbox values. I have a simple...
21 Nov 2021 by #realJSOP
There's nothing you can do about the act of query string modification. However, just because it can be done, doesn't mean you can't take steps to protect yourself. Take a look at this: HttpModule to encrypt query strings[^]
25 Oct 2021 by User 15367957
StreamReader stream = new Strear(bulkfile); } What I have tried: This code reads URL's from a text file and then gets the response and displays it
23 Oct 2021 by Richard MacCutchan
Look at your code, you set the textbox to the HTTPResponse for a URL. But then next time round the loop you do the same. So after processing all URLs the only data you show is from the last one processed. You need to append the response to the...
23 Oct 2021 by Member 14784148
Hi, I'm developing a web page using Tailwind Framework and their JavaScript Icons Tabs. It works great except for when I click on button Download at third tab, it will go direct to first tab.. T_T.. Im still new for this, any help would be...
15 Oct 2021 by davidcafu412
Hi everyone,Recently I have been trying to use Bootstrap Switch for my ASP.net Web Form CheckBox component. When I load the page, I can see the switch, but when I click, nothing happens. Below here is my code :
11 Oct 2021 by candijen
The user enters a link in textBox1 and hits the button and the code below prints it in a listbox but only once. If the user enters another URL or the same URL it does not get saved into the listbox how can I take the user input multiple times...
11 Oct 2021 by Richard Deeming
Quote: ...WebForms... List hll = new List(); It looks like you're storing your list as a field within your page. That won't work in WebForms - every time the user causes a post-back, a new instance of your page class...
11 Oct 2021 by BillWoodruff
You just discovered the no-datasource-refresh when new Item added to DataSource behavior that most of us (ouch) discover. The best way to fix this is just to use a 'BindingList [^] // create and initialize at class level scope: private...
10 Oct 2021 by candijen
I have this code but it does not seem to be displaying the tittle on label2 when an input such as "https://www.google.com" is taken from the user in textBox1. I am using a windows forms application. What I have tried: string title =...
10 Oct 2021 by OriginalGriff
The only way to get the title of a website is to fetch the page and extract the text in the title tag. This should help: Html Agility pack | Html Agility Pack[^] - it can read a site from a URL, and extract the title in a couple of lines of code.
10 Oct 2021 by candijen
This is my code : public static string getTitle(string htmltext, string startWord, string endWord) { int start, end; if (htmltext.Contains(startWord) && htmltext.Contains(endWord)) { ...
10 Oct 2021 by OriginalGriff
Do you mean the String.ToUpper Method (System) | Microsoft Docs[^]? If not, you are going to have to be a lot more precise about exactly what you do want ...
7 Oct 2021 by Richard Deeming
The local script is using a relative source. The file must be in a folder called Scripts within the same folder as the current URL. For example, if your URL is: https://somesite.local/folder/page1.aspx Then the script file must be:...
7 Oct 2021 by Xillo
Hello! I was using bootstrap modal with bootstrap.min.js in Scripts directory of my project. Suddenly it stops working... Not working: In this case everything looks to...
5 Oct 2021 by OriginalGriff
Don't use a regex - it's not a good choice for HTML processing. Instead, use the HTMLAgilityPack[^] and it becomes a couple of lines of code. HtmlWeb web = new HtmlWeb(); HtmlAgilityPack.HtmlDocument doc = web.Load(url); ...
5 Oct 2021 by candijen
Trying to get the title of a website URL entered by the user in a textbox but I am not sure what to put in place of "source". String title = Regex.Match(source, @"\]*\>\s*(?[\s\S]*?)\",...
5 Oct 2021 by candijen
In my web form want to check textBox1 input text for the URL and I want to show a message 403 Forbidden but I am unsure about what the user needs to type in and what I need to check for in order to display such a message to the user. What...
5 Oct 2021 by candijen
textBox1.Text!= "@" ^ (\b(http | ftp | https):(\/\/|\\\\)[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=% &:/ ~\+#]*[\w\-\@?^=%&/~\+#])?|\bwww\.[^\s])"); I want to check if the user has put a correct URL format but this does not seem to be working. I have...
5 Oct 2021 by RickZeeland
See: Uri.IsWellFormedUriString(String, UriKind) Method (System) | Microsoft Docs[^]
23 Aug 2021 by Slow Eddie
I am creating an eCommerce website for a client. I am using web forms. I do not know how to print a copy of the Order to the printer of the user logged in to the web page. I would appreciate any help you can offer me. What I have tried: I...
23 Aug 2021 by Patrice T
Quote: I do not know how to print a copy of the Order to the printer of the user logged in to the web page. Basically, you don't. On your site, you generate a page printer friendly or generate a PDF with receipt, and the client prints it if he...