Questions tagged [webforms]

Web Forms is a part of the ASP.NET web framework. It is one of the programming models you can use to create web applications. Web Forms are pages that users request through their browsers and that form the user interface (UI) that gives web applications their look and feel.

1
vote
0answers
11 views

Solving cookie replay attack in asp.net webforms

following this answer on StackOverflow, Microsoft has suggested to do the following actions: Clear the cookie. Set the Response.Status property to 401. Make a call to the Response.End method that ...
0
votes
1answer
7 views

Unable to Use repeater item on Item bound function

MY code throw exception on repeater itemDataBound Additional information: Unable to cast object of type '<>f__AnonymousType4`18[System.String,System.Int64,System.String,System.String,System....
0
votes
0answers
17 views

Calling asp.net webform postback from select2:select event

I am trying to trigger a postback handler when the user selects an option from a select2 dropdown. When I try using the code shown below, I receive the error message: "Invalid postback or callback ...
0
votes
0answers
25 views

How to create a Custom Authorize Attribute by Attribute class in ASP.NET Web forms

I want to use authorization with Attribute for each page. For example I have CardOperation page and I want that only Administrator can use this page I have created AuthorizeRolesAttribute as ...
0
votes
0answers
22 views

Preventing malicious user from accessing a page after logout [duplicate]

I capture a Get request to an .aspx file with the help of Burp Suit, When I log out of my application by using FormsAuthentication.SignOut();, If I repeat the previous authenticated GET request it ...
0
votes
0answers
18 views

IdentityServer4 SignOut in Web Form Application

I am using Identityserver4 for Authentication of multiple application. it works well with MVC clients but I'm facing issues with Web Forms. When I log out from IdentitysServer the Webforms Request ...
0
votes
1answer
20 views

CS0103: The name does not exist in the current context, For all controls in page?

I have imported a custom control to ASP.NET (C#), the control name is HijriGregDatePicker.ascx which has a pop-up calendar on both Islamic and Gregorian Calendars. My Problem when Compiling ...
0
votes
1answer
15 views

Return datalist linkbutton text value into a label

I have a datalist with a linkButton showing warehouse location numbers, when clicking on this datalist linkbutton I need the selected location number to show in a label. I am stuggling to make it ...
0
votes
0answers
8 views

Avoiding Button click event when page is refreshed does NOT work in my application

The problem is, the button click event executes when the user refreshes the page after pressing the button. Here is the solution I have found. The idea is the code in Page_PreRender only executes ...
-1
votes
0answers
36 views

Why date is throwing startIndex cannot be larger than length of string error? [duplicate]

I have wrote this method public static DateTime UTCTime() { var client = new TcpClient("time.nist.gov", 13); using (var streamReader = new StreamReader(client.GetStream())) { ...
0
votes
0answers
13 views

ASP.NET WebForms - Forms Authentcation losing session behind load balancer on homepage

I have a .NET 4.6 WebForms application running on IIS 10 on 2 web servers which are load balanced. When accessing a backend server directly, if I log in (using Forms Authentication) then my header ...
0
votes
0answers
25 views

GridView RowCommand Not Firing After Deleting Column

I have a GridView with some data and a couple LinkButton columns. If the user doesn't have a specific role, I remove one of the LinkButton columns from the GridView. My problem is that when I remove ...
1
vote
0answers
23 views

find control not able to find controls that created with literal control

this is MyFirstRow in my .aspx file: <ul class="dropdown-menu" id="MyFirstRow" runat="server"> I created the control with this Code in CodeBehind : Control Con = FindControl("MyFirstRow"); ...
0
votes
1answer
17 views

How to call an authenticaion function as a middleware or as an authentication filter in WebForms ASP.NET?

My goal is to make clients connect to their personal area which is an SPA made in Vue.JS 2. For the moment, my token generator and validator work fine (I've tested them with Postman) Since I'm ...
0
votes
0answers
17 views

Dropdownlist control within an update panel causes postback when using arrow keys, but not with mouse

I have a custom control that has form based child controls. The child control in question is System.Web.UI.WebControls.DropDownList. The page my control is within handles the update panel. I do not ...
-1
votes
0answers
21 views

Sending Webform Data to a third party analytics tool

One of our 3rd party analytics tools need access to webform submissions data (Form name, submissions entries, date etc ). Could anyone please suggest any drupal web service that could provide read ...
-1
votes
0answers
5 views

Can window.ShowModalDialog return a value to a web form running in another web server?

When user clicks a button in my legacy Intranet web form, the button's link redirects browser to another lookup web form running in a different Intranet web server. User selects a value in the lookup ...
-1
votes
0answers
7 views

Add row to table on web form in asp

I tried to add rows to table using add button.But I am getting "Object reference not set to an instance of an object" error. protected void lbAddLine_Click(object sender, EventArgs e) { ...
1
vote
1answer
43 views

Where is ViewState store if it is disabled

I have property (in ASP.NET webforms) writen like this: public string QuickSearchText { get { string value = (string)ViewState["QuickSearchText"]; return ((value == null) ?...
-3
votes
0answers
17 views

asp.net dropdownlist selected index not firing in Chrome some versions - not in updatepanel

I am using dropdownlist which is binded to a database table. It has AutoPostBack = true and Selected Index change event. The page contains some UpdatePanels though but this dropdownlist is not in any ...
0
votes
0answers
72 views

How do I write to an open Excel spreadsheet with ASP.Net using EPPlus?

I have an ASP.Net WebForms site which calculates a value based off an image. This value is then written to an Excel spreadsheet. The calculations work fine, but I am having problems writing the ...
0
votes
1answer
40 views

Populate Drop Down List based on multiple user roles

I am trying to populate a DropDownList based on roles. I have a view in SQL with the value and text of each item based on the user role (Windows Auth) and can populate the DropDownList if a user was ...
0
votes
1answer
15 views

where to set default value of session variables

I have an older .NET 4.6 project that uses web forms. I have a Session variable that I use to track if a user is logged in securely or not. After a user logs in using a login form and after a few ...
0
votes
2answers
53 views

Call an asynchronous method in a non-asynchronous asp.net page

I am facing an issue with two different endpoints in my single asp.net app. Basically, the issue is that one of the endpoints does not allow asynchronous methods in the page and the other endpoint ...
1
vote
0answers
40 views

How to use Microsoft.AspNetCore.Identity with an old web forms project?

I have an old web forms application that uses membership provider. I want to use an existing .net core identity project instead of membership provider. Where and how can I configure it in my old web ...
0
votes
1answer
28 views

ASP.NET WebForms - routing gives 'page not found error '

I am using asp.net routing and getting a 404 error. If I do not use an id value then I can see page. But I want to pass iddata with route and getting 404 Page Not Found error. Not sure why we ...
0
votes
1answer
37 views

asp.net inheritance and classes confusion

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). Here is ...
0
votes
1answer
11 views

Google Links taking to wrong screen in asp.net, how to redirect to main page?

Google search Links are taking to admin screen instead of the main screen for the public. How can I check in my code in ASP.Net Web forms to redirect from Admin login screen https://www.xxxxx.com/...
0
votes
2answers
34 views

instantiation of objects as an attribute vs instantiation of objects in most methods

Using C# webforms and the included code samples, what would be the correct way, or cons/pros to instantiate objects for the program, as attributes of the class (option 1)? Or in every method the ...
-4
votes
1answer
51 views

How do i generate x amount of random numbers depending on an input [closed]

I got a project for school where i want to simulate a sort of lottery where the user has to input how many balls there are and how many balls there'll be taken out of the pot so basically the first ...
1
vote
2answers
36 views

ASp.net Webform multiline textbox adds line break on page load automatically

From last one/two weeks i am noticing that any multiline textbox that i am using in asp.net web-form based website adds line-break to textbox automatically. This has never happened before i ma ...
0
votes
0answers
14 views

ASP.NET Webform how to use Ninject.Web.Common.WebHost Prop Injection

I have bind all my services in App_Start Ninject.Web.Common and try in my aspx pages [Inject] property injection. How can I use property injection ? My exception in my webform project.All my injected ...
0
votes
0answers
31 views

Logout from the masterpage in asp.net

I have a logout button on the Master page, and my child page has some text box that is set to Required Field Validator. Now if I try to log out from the child page it causes validation and logout ...
-1
votes
1answer
26 views

show a message when user doesn't select a date from the calendar

I am new to ASP.NET and C#, What I want is to show a message to the user "Please select a date!" when the user doesn't select a date from the calendar! I know that we use an If statement for it but, ...
0
votes
0answers
26 views

Getting Undefined While Trying to Get Array from Form

I'm trying to build an array of subtasks from a web form and I'm getting undefined when I try to console log it from at the post request with node.js & body parser. <form action="/add-project"...
-1
votes
4answers
41 views

How to hide a gridview column in a button click event out side gridview

I have a gridview as shown below and i want to hide a column named FREQ_BAND ,second column in button click named btnPmtCalculation which is out side gridview .How to do this ? i reached till this ...
0
votes
1answer
35 views

Dynamically create individual user folders in ASP.Net Web Forms

I created an ASP.Net website with the Web Forms Template - - with its default SQL Database for membership - - in Visual Studio (copies in VS 2015 and VS 2017). I am familiar with dynamically creating ...
1
vote
1answer
35 views

Please I was trying to connect my project to a database but i got an error: the name ‘textbox’ does not exist in the current context

This is my aspx.cs code for the connection which I tried to use and it gave me the error using System.Data.SqlClient; public partial class index : System.Web.UI.Page { SqlCommand cmd = new ...
0
votes
2answers
63 views

Why does this task cause a deadlock? [duplicate]

.NET 4.7.2 website using System; using System.Threading.Tasks; using System.Web; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ...
1
vote
1answer
53 views

File.Exists() file not found after impersonate

Firstable, I am in WebForms ASP.NET. In a method I wrote, string source = Global.PathTempFile + fileNamePosted + ".htm"; using (FileStream fs = new FileStream(source, FileMode.Create)...
0
votes
1answer
38 views

How to delete third-party domain cookies from GDPR-compliant website?

Working on a website that uses scripts that can create their own cookies (Google Analytics, HotJar, Facebook, etc...), I noticed that they create cookies in my website's domain as well as their own ...
1
vote
2answers
21 views

How to Invoke autocomplete jquery function when textbox clicked in ASP.net

In my form, i have few selection controls and textboxes. I want to show autocomplete options in textbox getting value from database. THere are more records in database so im filtering the records by ...
0
votes
0answers
24 views

how to retrieve big data from Database into Gridview in ASP.Net? without paging

I have a gridview in which I have bind data from Database. The Problem is The data is approximately 12000+ rows and It is taking too much time to load the gridview. I don't want paging in my Grid. So ...
0
votes
0answers
13 views

ASP.Net Webforms with SumoSelect

On "Page_Load" I fill a DropDownList with my data source: lstBoxGrupAcessID.DataTextField ="Description"; lstBoxGrupAcessID.DataValueField ="ID"; lstBoxGrupAcessID.DataSource = new BLLCompany()....
3
votes
2answers
43 views

Why is my JavaScript code not working on my ASP.NET web forms page?

I am running into a problem with a form submit in my web forms page. I have a function in place that should after confirming by selecting OK, do a document.forms.submit and send the user to another ...
0
votes
2answers
66 views

C# date compare function producing wrong result

I have two columns DueDat and PaymentDate of a datagridview. I want that if payment has made either before or ON or after due date the result should be Paid. I need following result while the when ...
0
votes
0answers
13 views

How can I allow calls from another host to an asp.net application that has identity authentication?

I have a webform application at xyz.com that has identity authentication system. Here are some of the relevant configurations. [assembly: OwinStartup(typeof(CRM.Settings.Models.Startup))] ...
0
votes
0answers
8 views

How to pass multi file uploads to the next form

I have a file upload control on an ASPX form that allows multiple file uploads... <asp:FileUpload runat="server" ID="AnalyseMultipleFiles" AllowMultiple="true" /> Now the problem is when I ...
0
votes
0answers
24 views

Asp.net get posted values from an html form in c# using Request.Form an get array value

<input type=hidden name='field[size][large]' value='40' /> <input type=hidden name='field[size][medium]' value='32' /> <input type=hidden name='field[size][small]' value='12' /> <...
0
votes
0answers
19 views

How to sign out properly from the previous session?

A user is logged on to a website in Firefox. He then copies the same URL and signs in using Google Chrome. While signing in using Google Chrome the user is prompted to sign out the previous sign-in ...