How to pass values from one .aspx to another - asp.net

I have a user id by using query string and i want to retrieve other data directly from the database(i dont want to use query string {}& name={}..like that further) anybody can help me pl.. i am beginner

If you don't want to use querystring than you can use session or a property in the page which you can set from the calling page.
Pijush

Related

Manually set the current item in a form

What is the code to manually switch a form to a specific record? I was trying to use relations but I can't make a relation to a calculated table, which is where this is coming from, so I have to hardcode which data is populated.
I'm looking for something like
onLoad()
(read the ID from page properties, which I use for globals)
widget.item.select(id);
I think you would want to use:
widget.datasource.selectKey(id);
This works on the assumption that your record is currently loaded in your client however. If your record is not loaded then this will not work.

How to pass more than one value in QueryString and how to retrieve it in other form

How I can pass more than two value and how I can retrieve it again in different page and also in same page. If I retrieve in same page and perform operation like delete, how can I do that?

Using a table display method in a query or view

I'm trying to make a query against the table HcmWorker and related.
But i want to figure out how to get the result of the display method HcmWorker.primaryDepartmentName() into it's own field in my query.
I also tried creating a view to execute the function via a ViewMethod but that doesn't seem to work as ViewMethods only inject code into the final query against the view.
I'm NOT making a form. The end result has to come through the QueryService.
Sorry, but what you are trying to do is not possible.
You could calculate a non stored field in the postLoad method, but that would impact every access to your table, and it would most likely not work in the context of a query service.

Get Filtered List of users using Forms authentication

I am using forms authentication and need to get a list of users that have a certain role and have a certain value in a certain profile property. The way I am doing this is to call Membership.GetAllUsers and then looping through them and checking the roles and profile. Is there a better way to do this in 1 call so that I don't have to get all users back and iterate?
Thanks,
Sachin
You may use GetUsersInRole() method.
string []users=System.Web.Security.Roles.GetUsersInRole("role");
You might want to replace Membership.GetAllUsers with Roles.GetUsersInRole(string roleName) - at least you'll have less entries to check for your custom field value.

Keep ASP.NET ViewState without being passed via QueryString

I have a form with its method being "get" that passes the variables and their values to the query string, respectively. However, it also passes the viewstate variable in the query string. Now, I have a very long viewstate value on the given page, and if passed in the query string, the viewstate variable will cause the page to error out, due to "too long of a query string" which happens to also be too long of a url.
I cannot merely remove the viewstate variable - I need it. But I need to pass the viewstate variable along via some method other than get when the form is submitted, while the other inputs of the form (the non-hidden inputs) are appended to the query string. Is there any way to accomplish this?
Can you change the method to "post" and then use request.form to get your variables?
Otherwise, you might be able to use the session object...
...or a serializable class object
...or a temp table in a database
Several different options

Resources