webforms

implementing security with session variables, how it is insecure

三世轮回 提交于 2020-01-04 06:57:36
问题 I am doing web based projects in dotnet. Currently I am implementing security using session variables. I keep current user id and user type in session and authenticate user from these session variables (say Session["UserId"],Session["UserName"] and Session["UserType"]). Please help me understand how this could be insecure. I've heard that such security can be broken and applications can be hacked very easily, like it is possible to get session id and directly connect to that session id etc.

Control modification in presentation layer

痞子三分冷 提交于 2020-01-04 05:48:05
问题 I am using GridView and the data binding occurs in Presenter layer but the cell 1 for example has to be modified and converted to a HyperLink control then I have to call the RowDataBound event in Presenter layer and do the modification inside that event.Is this a OK with MVP? 回答1: I would typically do the data binding and event handling at the View level. By doing it in the Presenter, you are creating a dependency between the Presenter and the View that you want to avoid. I'm not sure how you

Asp.Net SQL Update Statement

主宰稳场 提交于 2020-01-04 05:31:33
问题 I have an Asp.net application on my page the user requests for a user to be removed. This then populates my 'Admin_TaskList' db. An administrator then goes in the secure area of the site and enters the users name and clicks a button. Upon the confirmation, the user is then deleted from my 'Users' db (already got this working) but I want my 'Admin_TaskList' db 'Status' column to change from 'To Do' to 'Completed'. As I sad I have the delete bit working but I am struggling updating my other

Treeview validation

荒凉一梦 提交于 2020-01-04 04:40:22
问题 The treeview has leaf node checkboxes.I need to validate the treeview if atleast one of the node is checked and not more than a specfic(say 3 nodes) number of nodes a user can select. Note:The Treeview is a asp.net treeview(not an ajax treeview) 回答1: Alright, since you didn't mentioned what type of validation you want, I'll do both client side and server side. My TreeView is named tvTest First, add a CustomValidator to you Asp.Net page: <asp:CustomValidator ID="CustomValidator1" runat="server

Is there an equivalent of T4MVC for webforms?

北战南征 提交于 2020-01-04 02:46:08
问题 I use T4MVC inside my asp mvc projects, mostly because it's brilliant. Is there an equivalent for asp webforms? 回答1: It turns out David Ebbo (he also did the T4MVC stuff) has given asp webforms a little love as well: http://blogs.msdn.com/davidebb/archive/2009/07/12/asppathguru-a-little-t4-love-for-asp-net-webforms.aspx 回答2: PageMethods provide some strongly typed capabilities for WebForms 来源: https://stackoverflow.com/questions/2446679/is-there-an-equivalent-of-t4mvc-for-webforms

Can ASP.Net form have method=get or post attribute?

六眼飞鱼酱① 提交于 2020-01-04 02:27:25
问题 I am new to asp.net. My question is, can a ASP.net form with runat="server", have a method attribute in it? For example: <form id="form1" runat="server" method="get"> ....... </form> Is this possible? 回答1: Thanks for your answers. I would like to share some points which I found. By default the form with runat="server" , will have method="post" . But when we request a page for the first time, (i.e) request is not a postback, the method="get" . And it becomes method="post" ,while postback. I

Passing JSON serialized data via hidden field

Deadly 提交于 2020-01-03 09:57:27
问题 In ASP.NET WebForms I want to pass arbitrary data from server to client and back again. I am serializing to JSON and have been simply producing JavaScript that creates the object on the client. I have no problem sending data to the server with ajax, but there are situations where I also want to send a Javascript object data back to the server on postbacks. So I guess it needs to be in a hidden field. A couple general questions about this. 1) What is the best way to do this in terms of

ASP.NET Web Forms Structure

只愿长相守 提交于 2020-01-03 04:24:20
问题 We have an ASP.NET Web Forms solution we made a few years ago. This solution had the following layers: Data Access layer: where we had the access to the data, just a few procedures like this one public void execute_NonQuery_sql(string SQL) {...} Data Entities: in this layer we defined the different entities and the queries to access the database. public static DataTable sel_links() { mySQL_DA da = new mySQL_DA(); string sQuery = "SELECT Id, Name, WebSite, Summary FROM links ORDER BY OrderPos

RequiredFieldValidator client side validations do not work on IE 10

ぐ巨炮叔叔 提交于 2020-01-03 01:21:47
问题 All my webforms using RequiredFieldValidator, RegularExpressionValidator and ValidationSummary are not working on IE 10. It is working fine on any other browsers. It is strangely doing postback which does not happen on any other browsers. Another strange thing is when I open developer console(F12), it seems to be working but it is still doing postback. All these Validations should occur at client side by default. Has anyone here faced similar problem? 回答1: please check these link1 and link2

Multitenancy in asp.net web forms

核能气质少年 提交于 2020-01-02 23:13:38
问题 i have created a new web forms application in visual studio 2010 with just two pages Default.aspx and About.aspx . what i want is that when i debug the app in visual studio development server it and enter http://company1.localhost:1023 it should just display Default page with message This is default page for company1 . How can i do it with just playing with url routing as opposed to doing settings in IIS Note: I understand that multi-tenancy is a big word and should not be used for such a