Glad it helped. I can't even remember how and where I stumbled across that... allowed me to do a TON of client side automation on forms. Probably NOT the best solution, but in specific areas, it works well...
hey there, I'm still learning C# and am having some issues with a login I've created. The login page gets the user info into an object and sets the cookie no problem. But when I go to the next page I can't seem to figure out how to get at the object I created on the login page. Here's a snippet of what I've got...
privatevoid cmdLogin_ServerClick(object sender, System.EventArgs e)
UserDetails oUserDetails = validateUser(txtAssocNum.Value, txtUserName.Value, txtUserPass.Value);
if (oUserDetails != null)
//UserDetails oUserDetails = new UserDetails();
Response.Cookies["UserID"].Path = "/";
Response.Cookies["UserID"].Value = oUserDetails.UserID.ToString();
//oUserDetails = null;
lblMsg.Text = "The information you provided does not match our database.";
There are ways, but they're neither fancy nor are they new.
I suggest that you google Asp.net request.querystring Asp.net session Asp.net Page State
for the most common methods to pass data between pages.
I've been grappling with this for a few days now, and am no further forward, here's the scenario:
I have a page that contains the following
linqDataSource : productListDS (Selects * from products table)
GridView : gridProductList (Data source is productListDS)
linqDataSource : productDetailDS (Selects * from products table where id == id)
DetailsView : detailsProduct (Data source is productDetailDS)
The gridview lists all the products in the data source, with paging and select button enabled, when the select command is clicked the details view is then updated to show all the fields of the selected product and has the 'Edit', 'Insert' and 'Delete' commands enabled.
The gridView ONLY shows 5 columns from it's data source (The AutoGenerateColumns option is false) and i'm constructing the colums manually in the columns tag. I have the DataKeys set to id, and when i click the select button everything works flawlessly.
My problem comes when i do an Insert/Delete/Update.
As an example if i add a new record by putting the details form into insert mode, fill in the fields and then click insert, it inserts the record into the underlying SQLServer database, but the gridview does not update.
I've tried doing a 'gridProductList.DataBind()' in the page load, and in the details view 'ItemInserted' event, and still no luck. If however i browse away from the page, and then back the gridView then displays the newly added products. Even pressing F5 to force an update does not work, in fact all that achieves is to resubmit the last insert and add another new record to the DB.
The linq Data SOurce is connected to a LInqToSql DBML class.
Does anyone have ANY ideas on how to force the Grid View to update and show the table changes made using the details view without having to browse away from the page and then browse back.
Does ths even apply when i'm not doing the original databinding manually, i'm just letting the datasource/datagrid sort it out them selves. Calling the DataBind() proc just seemed like a sensible thing to try to force it to update.
I think the most common thing is this. Someone creates a website within visual studio and so the security on the directory is handled for you. Then you move the directory to someother location for deployment and it doesn't work. Typically this is because the service that is running doesn't have proper access to the new directory. However, it would be more helpful if you shut of friendly error messages and posted what the exact error is that your getting.