|
This is probably a very simple question, but I'm working on my first ASP.NET application. I want to use the response.redirect function to send my application back to the start of the website. The main page of the site is default.aspx.
I tried, Response.Redirect("/") , but that put me too far back and did not include my virtual path.
The proper path should be something like this: http://myserver/vpath/default.aspx
What is the proper way of redirecting back to the home page ?
Thanks.
|
|
|
|
|
Hi
Did you try Response.Redirect("~/") ? or simply Response.Redirect("~/default.aspx") ?
Talal
-- If this is a post that has been helpful to you, please vote for it. Thank you!
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." --Rich Cook
|
|
|
|
|
Just use
Response.Redirect("Default.aspx");
And when you want to refer to sub folder then either use "./FolderName/FileName" or "~/FolderName/FileName" (like the previous poster suggested)
|
|
|
|
|
That will not work if the current folder is not the root.
|
|
|
|
|
Yes, but he has specified http://myserver/vpath/default.aspx and Response.Redirect("/") . And I dont think he has pages in the sub folders.
|
|
|
|
|
I may be missing something but
Response.Redirect("default.aspx", True)
should work.
If your default.aspx file is in a different subfolder, for example "Main" you would use...
Response.Redirect("../Main/default.aspx", True).
Hope this helps.
|
|
|
|
|
Wow. Such a simple answer. Goes to show you what happens when you "overthink" a solution. Thanks to all. I'm sure I'll have more questions as I continue to develop this first applicaiton.
|
|
|
|
|
hi.. can anybody there guide or help me to create a feature to change color of text using asp .net
|
|
|
|
|
You'll have to be a little more specific in your needs. You can use themes, CSS or other techniques.
only two letters away from being an asset
|
|
|
|
|
My knowledge of Asp.net still leaves a lot to be desired and I am having real trouble getting at some data stored in an array that I want to use to build an xml file dynamically.
I have an instance of a CalendarEvents class named mothItems inside of which is an arrayList named eventList. Once this arrayList is populated I am trying to get at the info in there to use it for the xml file. These are some of the ways I imagined it shouild be done for the title for example:
monthitems.eventList[0].title
mothitems.eventList.[0].title
monthitems.eventList[0].title.value
I tried so many possibilities that I can't remember them all.
Can someone please tell me where I am going wrong with this?
|
|
|
|
|
I would suggest using a generic collection rather than an ArrayList. ArrayList stores objects, to access the contained object it needs to be cast back to the original type. The generic collection doesn't need this and guarantees type safety.
only two letters away from being an asset
|
|
|
|
|
here is my database table:
ID int
PersonImage image
PersonImageType nvarchar(50).
at pageload i want to all the images from this table and show in a gridview or datalist.
i have tried so many tutorials but most of them in C#.
|
|
|
|
|
|
Hi,
I am using gridview component and b'cas of lengthy data i need to freeze my grid header for its height.
N!dh!
|
|
|
|
|
You can Freeze.
This is you CSS Class
.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
and set GridView HeaderStyle as following
<headerstyle cssclass="HeaderFreez" />
|
|
|
|
|
I stand corrected. That's pretty sweet.
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
In this case our header is not constant,i need header to be constant and inside grid records should be moved
N!dh!
|
|
|
|
|
NidhiKanu wrote: In this case our header is not constant,i
I didn't get you . It is not freezing your grid header?
You can also read This[^] article.
|
|
|
|
|
Ya i want same thing but wen i apply it on my grid,some time it happen that header become invisible or while scrolling on grid my header goes invisible after some time it goes visible.Is there any solution for it
N!dh!
<div class="ForumMod">modified on Tuesday, January 27, 2009 12:36 AM</div>
|
|
|
|
|
Hi All,
I have a custom server control (Multi selection drop downlist). This control contains AspxEditButton control(which is like textbox with button), check box list control and panel.I have to display all selected values in AspxEditButton at control is leaving that panel. How can i create LostFocus event for panel . Please anyone help me
Regards,
Anu
|
|
|
|
|
Client or server side event?
|
|
|
|
|
|
Hi, I am assigned a task to create a whiteboard in asp.net using c#
My problem is that in vs 2005 canvas is not available.
Is there any control or code which can be used as a canvas in vs 2005 as we can see that canvas is available in vs 2008 if we use silverlight 1 or 1+ version.
I have had googled for a number of site giving numerous solution using javascript and silverlight application.
Bu ti wanted to use the canvas like functionalit in asp.net 2005
I am really in great need of such code
Any help will really appreciated.
Thanks in advance.
abby
|
|
|
|
|
(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
regular expression i am using to check date for MM/dd/yyyy
now i want to accept M/dd/yyyy and MM/dd/yyyy format
please tell where to put what and this regular expression i am using in
ajax tab panel on M/dd/yyyy it gives error..
umerumerumer
|
|
|
|
|
If you need a date validator, use the following. It is so much easier than regex programming.
<asp:CompareValidator ID="TargetDateValidator" runat="server" Type="Date" Operator="DataTypeCheck" Display="dynamic" ValidationGroup="Default" ErrorMessage="The target date is not valid format = "mm/dd/yyyy" ControlToValidate="TargetDateTextBox"></asp:CompareValidator>
If you want to use regex try posting a question <a href="http://stackoverflow.com/questions/tagged/regex">http://stackoverflow.com/questions/tagged/regex</a>[<a href="http://stackoverflow.com/questions/tagged/regex" target="_blank" title="New Window">^</a>]
I'm awful at writing regex so I'm not even going to try and help you with that.
|
|
|
|