|
sorry sir i got it.thanks
|
|
|
|
|
following is code that i transferred a value to other..
how to transfer multiple values using application..... any sample code plz....
Application["userName"] = txtName.Text;
Response.Redirect("default.aspx");
default.aspx....
if( Application["userName"] != null )
Label3.Text = Application["userName"].ToString();
|
|
|
|
|
There are a number of ways.
for a fewer values, if data is not confidential, I will suggest QueryString.
as a sample:
Response.Redirect("default.aspx?UserName=" + txtName.Text + "&UserType=" + UserType);
If data is huge, use cross page posting.
There are a lot other ways like using session, caching, cookies, storing to database, etc...
all of them is used in their respective scenario.
Hope this will help. For details, just google about state management in asp.net.
Thanks,
|
|
|
|
|
You can simply pass this value using query string. You do not need to store it inside Application Variable.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
if it is through query string the entire data can be viewed in address bar.
the data is confidential so im trying with application and sessions..
im unable to get to transfer multiple values.
for one value its working... how to transfer multiple values....
Session["username"] = dr["username"];
Response.Redirect("default.aspx");
next page page load event
if(Session["username"]!=null)
TextBox1.Text = Session["username"].ToString();
|
|
|
|
|
Hello Friends,
I've to remove scrolling from a body tag of web page.
I'm using following line of code but that's not working in IE 7 but working in Firefox and Chrome
document.body.style.overflow="hidden";
|
|
|
|
|
Did you tired with scrolling="no " ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Sorry, its not working
document.body.scrolling="no";
|
|
|
|
|
Hi All...
I am using ASPNET MembershipProvider with some Roles.
After authentication for user i want to get his Role.
how is it possible??
i tried but Roleprovider is giving all users in particular Role..
I want That Logged in User's Role in Session..
Thanks & Regards
Sachin
|
|
|
|
|
Once the user is authenticated you can use Roles.IsUserInRole("Role") to find out if they are in a role and GetRolesForUser to find out what roles they are in.
This[^] page may help.
|
|
|
|
|
Hi All,
im loading user control using ajax/json, via web service.so in my control i have button , when i click that it should save some details to db, my problem is when i click that button its show the error Invalid character in a Base-64 string , and also its postback without check the regular expression validation.pls help me to solve this problem
Thanks,
|
|
|
|
|
Hi, I had the same error recently and was helped out by this[^] blog post.
|
|
|
|
|
hi thanks for help,
i found this site before i post this issue to here, but that didnt help to me.
|
|
|
|
|
Can anyone tell me that how to load swf files in ASP.NET?
Thanks
|
|
|
|
|
|
|
but I want to load swf file in a table in my aspx page. how can I do it?
Plz help me?
|
|
|
|
|
|
Purish Dwivedi wrote: I want to load swf file in a table in my aspx page.
As per the article goes it showing the Flash file inside a table only.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi sir
i am trying for showing image immediately after upload.but image can not get the path of image.but my upload button is doing well .it saves the images at correct location.code is following.please point out my fault.
if (btnUpload.FileName == "")
{
return;
}
try
{
Img_Item.ImageUrl = "";
string name1 = btnUpload.FileName;
bool CheckImg = img.CheckImage(btnUpload.PostedFile.ContentType);
if (CheckImg == false)
{
Label2.Text = "Not a Valid Image";
return;
}
string Act_Path = txtProductId.Text + ".jpg";
string pro_img = txtProductId.Text + ".jpg";
string su = Server.MapPath("") + "\\images\\" + pro_img;
Boolean Img_Change = true;
btnUpload.SaveAs(su);
bool check1 = File.Exists(su);
if (check1 == true)
{
Label2.Text = "Upload Successful";
Img_Item.Visible = true;
Img_Item.ImageUrl = su;
lblImgPath.Text = su;
btnAdd.Visible = true;
Label2.Visible = true;
}
else
{
Label2.Visible = true;
Label2.Text = "Upload Failed";
}
}
catch (Exception exp)
{
Label2.Visible = true;
Label2.Text = "exp.Message";
}
}
|
|
|
|
|
vikas shukla wrote: but image can not get the path of image
Right click on that Image and check the path from properties. Is it valid path ?
I guess this is the problem due to the page refresh. Image control is not refreshing after upload of image. Please check .
|
|
|
|
|
sir one more thing is that when i add an image from property of image it takes path like ~/Images86877.jpg.
and i am using
string su = Server.MapPath("") + "\\images\\" + pro_img;
can it be problem?
|
|
|
|
|
vikas shukla wrote: string su = Server.MapPath("") + "\\images\\" + pro_img;
This is fine as you said image saving in proper location.
You need to change here
vikas shukla wrote:
Img_Item.ImageUrl = su;
Img_Item.ImageUrl="~/images/" + pro_img;
This will resolve your issue.
Let me know if it resolved.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thank u sir thanks u very much you have solved my problem.can i get your yahoo id?
|
|
|
|
|
vikas shukla wrote: thank u sir thanks u very much you have solved my problem.
. Then you should mark the post as helpful.
vikas shukla wrote: can i get your yahoo id?
mca_abhijit@yahoo.co.in
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|