Session Object Not Work With Combined Mvc And Webform Application?
Jan 21, 2010
Environment used - Asp.net mvc 1.0 with c#
Problem -I have used simple mvc application. and also added webform into mvc application.and it is working fine. but when i used session object for sharing data between mvc and webapplication. it is not working. I have put Session["logon"] = "logon"; object into mvc controller and when i access this into webform then there is no value in session object.
We are going develop a web application using asp.net. This applicaton is going to server 50 users per day and 40 users concurrently. As the user count is less, we are planning to have two webservers clustered under a webfarm. We are planning to go for a Sticky Session. Netscaler is the load balancing and reverse proxy we are using at hardware level to route to the same webserver till the end of the client session.
1. Do I need to implement any handler at asp.net level to route the session or to provide browser cookie details of session to NetScaler? If so, what should be implemented in detail. Any sample code will also be helpful.
2. I need to maintain a big chunk of object information in session. Does a webserver can handle it?
3. At the hardware level how ReverseProxy works to navigate it to the same webserver? I want conceptual details of it from a web application end.
I have an asp.net application with c# language. I have a common class which maintain the constants and static variables and fields. I also have a login page. If the user logs in successful I set IsLoggedInSuccessfull as a static boolean variable in common class.
My question is: Will this only work for a specific user session or for overall application ?
Edited: Based on some answers I got another question here.
let say i am using the Static method as Authenticate(User objUser). intention is to call this method when user clicked log in button. where on login button I am let say prepare the User object with certain parameters required for login, then passing to this method. what would be the impact there? let say I have single server for now (no server farm or garden). then there will be the single application level method to authenticate the user, right? and say 10000 user are going to logging in to this site/application then how authenticate() method comes in behaves ? will CLR automatically manage threading there ?
creating session object to use across my web application.
I'm working on an application that requires a login control upon which we would need to set around 10 different session variables (related to the user). These values are required/ used many times across the web application so it would be really handy to create a class/ object which can be accessed in all pages with doing multiple lookups into the user table on DB. Also, I would like to avoid any conflicts with multiple developers using same session variable names and thereby causing issues down the road.
I know this is not a new kind of request and must have been created and used by many of the developers.
actually i got confused in session object,view state,application domain, can u tell me where i have to use these object. can u define some sort of condition in which session object must used & view state must used & diffrence of thses object where we can only use session & where i we can only use view state
I have a web form with several DDL and text boxes some of them have post backs some dont
the DDLs have 3 or 4 Values like Yes , No or Often, Regularly, Never
a user is able to select the values and save his selection results on a sql server and a record number is generated on the save.
he is also able to retrieve his results via the same record number Via a subroutine called RecordSrchId all the text boxes get populated most of the DDLs get populated and results are selected but some of the DDLs dont get selected.
The DDLs for example will have Yes, No results as values in the list of items. The retrieved data from the sql is presented in a datatable and the value is cascaded down via the correct ID of the items for example "mydatatable.Tables(0).Rows(0)(2).ToString" where my datatable is the datatable and (2) is the item number i get a value from mydatatable as i have tested this with a Label control so its not returning null and the DDl have the correct list of values also in the correct case formats but for some reason it will give me an error below
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 1148:
Line 1149: crane_requirement_Frequency_40T0.Items.FindByText(mydatatable.Tables(0).Rows(0)(32).ToString).Select ed = True Line 1150: Line 1151:
[NullReferenceException: Object reference not set to an instance of an object.] FactFindMenu.recordidsrch() in C:inetpubwwwrootaspxfactfindDefault.aspx.vb:1149 FactFindMenu.Srch_Record_Click(Object sender, EventArgs e) in C:inetpubwwwrootaspxfactfindDefault.aspx.vb:1090
[code]....
the subroutine to retrive the date is below
Private Sub recordidsrch() Dim searchFactfnd As New SearchFactFnd ' custom class used to retrive data From sql server Dim mydatatable As New Data.DataSet ' Dataset/table used mydatatable = searchFactfnd.FactFNDTableID(Rcrd_num_Txt.Text) ' populates the dataset with the function FactFNDTableID via a record Id gained from a textbox and function returns a dataset/table contact_name.Text = mydatatable.Tables(0).Rows(0)(1).ToString
Items.FindByText(mydatatable.Tables(0).Rows(0)(32).ToString).Selected =True Items.FindByvalue(mydatatable.Tables(0).Rows(0)(32).ToString).Selected =True ddl.selectedvalue ddl.selecteditem if not ispostback then 'populate end if ddl.clearcontents
tried rewriting the html ddl to below and try variations above did not work
<aspropDownList ID="crane_requirement_Frequency_40T" runat="server" CssClass="largeinputd"> <asp:ListItem Text="Crane Requirements Frequency"Value="" /> <asp:ListItem Text="Regularly" Value="Regularly" /> <asp:ListItem Text="Often" Value="Often" /> <asp:ListItem Text="Seldom" Value="Seldom" /> </aspropDownList>  i know the values fro the data set are correct and not null and the values exist in the DDL could post back be causing this.
I'm implementing the MVP pattern within an existing asp.net webforms application and I was wondering if there is a clean way to map my form data to a data transfer object. I'm not particularly fond of implementing it this way:
I'm trying to figure out how to bind an EF4.0 object to my textbox control. I have a call to my business object that returns an entity CFUser that has a FirstName parameter on it of type string. However, after I make the call and bind the object, the codebehind executes which fills the BindUser property with the correct value. However, nothing shows up in the textbox.
I have 3 different work centers assigened to 3Text fileds on my webform DesignDate,CollectDate,TMSDate ).the process of job is likely to be DesignDate->CoolectDate->TMSDate.when i complete the Design process i will go for Coolect filed and put a date(which indicates particulr job due date)when i am moving from Current work center to nextwork center previous work center should be locked .is it possible to to do locking the textbox if already date exists in that field else allow to enter for text.My text fields are txtDD,txtCD,txtTMS.
In the VS2005 environment, when I test my session to make sure the page redirects to the main page (itself) if the session is null, it works. There is no error.
The function I use for this is:
[code]....
However, when it is in the production environment in IIS 6.0, when the session has timed out, and I then do a postback by doing some slider control, I see the page reload but immediately thereafter, it throws a Server Error exception of : Object reference not set to an instance of object.
however, why is it that the Slider1_TextChanged event fired even even after during page_load, the page was told to do a response.direct ?? shouldn't the entire page have gone through a full-page refresh life cycle ? why did it continue on to attempt to raise the Slider1_TextChanged event?
I want to be able to persist data across a session but do this outside of the built-in session state object. Why is a long story that I will not go into here. I just need to know where I can put data other than in the session object that will persist across the specific session.
Thus far working with asp.net webforms was very easy .... But never implemented URL Routing in webforms... I know asp.net MVC Handles URL Routing pretty well... How to get started with URL Routing in an asp.net webform application? For EX: [URL] i want it to be like [URL] Any good article to start with URL Routing asp.net 3.5
i am building a web application and i want to access a textbox which is on the index page from the login page. basically what i did is this. i programmatically created my registration form for new users and also login for registered users, now i want to display on the index page the name of the logged on user on the index as the page loads.
i would like to know how to use in the header of a webform an application parameters.Indeed, I have a virtual repertory in my application, and my webform make a reference to this repertory :
[Code]....
I would like to replace the path by an application parameter.hank to this, I will be able to just change one parameter rather than change each header of my webpages.
I am trying to run the 15 minutes movies MVC application but I got the following error:
Object reference not set to an instance of an object.
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
I will be creating a webform that will require online application and sending/uploading of resume that will later be forwarded to an e-mail address (the resume will be an email attachment). I badly need some tips on this! Really new at these things. I will be using VB to code the web form.
I am getting thid error Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error:
I am using a server control on a single web.forms page. I have to use this control on a web.forms page since its a server control, although this is actually a MVC project. So I created a web.forms folder and put my new page in it. I then copy the example code from the signature control. I get the following error:
The base class includes the field 'ctrlSign', but its type (WebSignatureCapture.SignatureControl) is not compatible with the type of control (ASP.signaturecapture_signaturecontrol_ctlsignature_ascx).
I know the code works because if I removed the ID attribute from the server control, it no longer gives me this error and my control renders. But I need the attribute for the ID so I can perform is post event
I am using this signature control. Here's the web.forms code...
I have to implement broker and dealer socket connection like in share market i.e. it should connect at 9 AM and stop at 3.30 PM and repeat in next morning ...
so following is my requirement
1) i have to create application object once in day at 9 AM and destroyed at particular end day 3.30 PM.
My question is how to destroyed application object at given particular time ... i think this can be done in application_end handler in global.asax ... but my question is when no request is made at that time then what happened..