|
Yes. you are right..
|
|
|
|
|
Hi guys,
I'm wondering if it there is a better way of doing this, I have 2 webpages, page1 and page2. I want to ensure that users would go to page1 before going to page2 (a button on page1, redirects it to page2), so that if the user types in the URL of page2, it will redirect to page1 first. I am currently using the Request.UrlReferrer.ToString() to get the the previous webpage and comparing it. If it is from page1 then page2 will open if not it will redirect to page1 (the code is below). I'm just wondering if there is a better way of doing this?
Thanks.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.UrlReferrer.ToString() != "page1")
{
Response.Redirect("page1");
}
}
}
|
|
|
|
|
I would put pages one and two on the same URL, as controls. Then I'd use viewstate to store if the user had viewed page one before allowing page 2 to show, and set something on the URL to show page 2.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Can that be easily done? I have a lot of controls in page1 and page2.
|
|
|
|
|
Yes, just move all the code from your aspx and aspx.cs to ascx and ascx.cs files. Then put those two controls on the one page.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: I would put pages one and two on the same URL, as controls
I think wizard control has similar property ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Yes, but the more you use the ridiculous built in stuff, the less control you have over what's going on.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
u r rite ...
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
Im working with a social network. To change password I use following code
MembershipUser usr=Membership.GetUser(username);
usr.ChangePassword(usr.GetPassword("no answer"), newpassword);
But following error occur: Current membership provider is not configure to allow users to retrieve and reset their password.
How can I configure?
shahdat
|
|
|
|
|
What have you tried ? Did you google the error message ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It a error from .NET compiler.
Im web developer of a social network site. I want to develop how a user reset their password when he forgot it.
I require method to change password.
shahdat
|
|
|
|
|
How about ChangePassword control ... ?
Apurv
“Never trust a computer you can’t throw out a window.”
(Steve Wozniak)
“There are only two industries that refer to their customers as ‘users’.”
(Edward Tufte)
|
|
|
|
|
You have to have the membership provider configured to allow for reseting of password. This will be in the web.config file under 'membership' you need to make sure your provider is configured with enablePasswordReset="true"
|
|
|
|
|
Hi,
string appdir = "http://localhost/myApp";
string strPath = appdir + "test.doc";
FileInfo f = new FileInfo(strPath);
I m getting uri format not supported error.
why this is happening??
Thanks
sjs4u
|
|
|
|
|
sjs4u wrote: string appdir = "http://localhost/myApp";
string strPath = appdir + "test.doc";
Why ?
Try to use Server.MapPath()
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks for the reply.
I am downloading file from server to localhost using windows application.
but I am using web service for file info and localpath.
Thanks
sjs4u
|
|
|
|
|
Let's start with, your code is a bloody disaster.
1 - do you REALLY intend to deploy this code with localhost as the URL ? So, it will only run on the machine it's deployed to, never to a server ?
2 - your code obviously won't build a full path correctly, as there's no slash between myApp and test.doc.
3 - the Path class will let you build paths cleanly, most of the time.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Let's Say
I am downloading test.doc file to this path(localhost path) :
string localfile = http://localhost/myApp/test.doc
Now it showing me the error. I am using windows application.I added web service in that project.
I am using Fileinfo Class where I am getting error
FileInfo f = new FileInfo(localfile);
Regards,
sjs4u
|
|
|
|
|
sjs4u wrote: . I am using windows application
OK, now I am stunned.
1 - what the hell are you doing in the ASP.NET forum if you're writing a windows program ?
2 - what makes you assume that localhost points to ANYTHING, let alone what you want it to, if you're writing a windows app ?
3 - why do you assume your end user has localhost configured properly to run this app ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hiii....
i have generated crystal report now i want that the report gets generated based on user
input.like when user give date range,name or anyother input then respective report get generated.
can u plz give me some idea or a link that how cud i do this.thnks in advance......
|
|
|
|
|
use the following code it may help
CrystalReportViewer1.SelectionFormula = "{timetableofteacher1.tid}=" + DropDownList1.SelectedValue + " and {timetableofteacher1.tname}='" + TextBox1.Text + "'";
if it helps let me know
|
|
|
|
|
hii didnt get u exactly.
wat is {timetableofteacher1.tid} and timetableofteacher1.tname
|
|
|
|
|
|
thnks i will go thru it....
|
|
|
|
|
i have to build the image viewer in C#.net application
these images would be displayed from the access database
any ideas how to start building it
or any tutorials suggessted for the beginners
either i have to use GDI+ or not
how i should start studying ???
plz can any one help
|
|
|
|