.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Post New Web Links

Specify page to redirect to when adding a item

Posted By:      Posted Date: November 25, 2010    Points: 0   Category :SharePoint

Hey guys/girls/aliens

When I add a new item to a list and I click on the OK button (NewForm.aspx), I want it to redirect to a other page
How can I do this?

Reason for this is because I modified the NewForm.aspx and added some javascript to it.
This causes the link to go to the Homepage instead of going back to the listview.




By the way, If i can solve this by adding the JS to the masterpage instead of the NewForm.aspx page.
Please tell me how :P

View Complete Post

More Related Resource Links

Adding a list item that populates a particular part of a page

I am trying to create a list view in sharepoint designer that when you enter a list value it populates the right part of the page. Background - I am creating a list for a marketing newsletter that when you fill out the list form it will populate the marketing newsletter on page. its to save recreating it every month. the list has drop downs for addition and department and the data is inserted on the page. thanksSharepoint Customiser

Redirect to item page after inserting


After inserting a new item, I would like to redirect to the page of that inserted item, instead of the list page.

How can I accomplish this?

Thks in advance

Redirect to a another page (from a new item form) with the new item's ID


Now, I have a custom form that redirects to another form. After submit the Ok button, it uses such link:


I want to redirect from NewForm.aspx to antoher's aspx form with the existing parameter IDO and new created ID (IDC), so the link would be:

http://site/lists/CustomerOrders/NewForm.aspx?IDO1=1&IDC={NEW ID}&Source=xyz/site.aspx?ID=1

I wanted to use http://spservices.codeplex.com/wikipage?title=$%28%29.SPServices.SPRedirectWithID&referringTitle=Documentation

but that function doesn't pass another paramteres, so the new link is:

http://site/lists/CustomerOrders/NewForm.aspx?IDC={NEW ID}

how can I pass the existing parameters (IDO and Source)?

Redirect to a mobile page

Hi please can anyone help? I have a simple website with a home page called defaut.aspx, also I have a page with in this site called mobile.aspx. My question is, bearing in mind that I posses very little knowledge of VB, what code do I need to place in the default.aspx to detect what kind of device someone is using and redirect them to the mobile page (mobile.aspx)? This needs to be quite up-to-date preferably for blackberry and nokia devices?


Detecting PPC device on startup page to redirect?

I was wondering (since a search didn't find any posts) if there is a way for my startup page to detect what kind of device (PocketPC or web browser specifically) is loading the page and if it is a PocketPC, then redirect to the mobile pages? I will only be using PocketPC's exclusively as a mobile device.

Thanks for any suggestions!

Dynamic Checkboxlist exception when adding to Panel when using Master Page


In essence, I am creating Dynamic Checkboxlist controls and adding them to a Panel.  It works well when I do not have a Master Page configure to this webpage. Once I have a masterpage congifured.. I get a "Object Reference not set to instance of object" error on the Panel_Control.Controls.Add(Checkboxlistnew) line:

protected void Page_PreInit(object sender, EventArgs e)
        XML OXML = new XML();
        alistChkBoxLabels = OXML.XMLTransform("C:\\Documents and Settings\..\\Config_new.xml", "config_options/check_box/applications/app/@name");
        int count = 1;
        alistCheckisFacility = new ArrayList();
        alIDTracker = new ArrayList();
        while (count <= alistChkBoxLabels.Count)

            Checkboxlistnew = new CheckBoxList();
            Checkboxlistnew.ID = count.ToString();
            Checkboxlistnew.Items.Add(new ListItem(alistChkBoxLabels[count - 1].ToString(), alistChkBoxLabels[count - 1].ToString()));

            String sAppName = alistChkBoxLabels[count - 1].ToString().Trim();

            alistCheckisFacility = OXML.XMLTransform("C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\WebSites\\User_Trial\\Config_new

Adding a cookie to a response.redirect vs. httpWebRequest


Hello, I will try to be as clear as I can be.  I'm sure this question has been asked but I can't find a suitable answer for this particular situation.

I need to be able to redirect the browser to a new 3rd party page while at the same time supplying a cookie required for some form of authentication on the 3rd party site.

I have managed to get this to work in the following manner:


'SessionID is predetermined by another HttpWebRequest/Response  

Dim sessionCookie As New Cookie("ezproxy", sessionID.Substring(1), "/", ".someother.site")

Dim CookieJar As New CookieContainer


rRequest = HttpWebRequest.Create("where I want to go")

rRequest.CookieContainer = CookieJar

rRequest.Method = "GET"


'Make the request and get the response.

rResponse = rRequest.GetResponse()


'Save cookie(s)

If (rResponse.Cookies.Count <> 0) Then

For Each cook

Adding table to a page, but the format lost when I use clear border



I added a table to a page, by default, the table layout is the light border. So, I add my content and the vertical align seems to set to the top. But when I changed it to clear border, the content of the table will set vertical align to center. Is there a way to change this back to top align but with the clear border. I don't think I can do this by what is available in the ribbon. Please advice.

Adding a custom ASP page to a sharepoint 3.0 site


I have a custom ASP page that I need to add to my sharepoint 3.0 web site.  I created a virtual directory under my website and placed the ASP file.  When I link to the ASP file, I get a 404 page not found.  To make sure I had the correct URL path, I created a test html file and placed in the same virtual directory and linked to it just fine.  I think it has something to do with managed paths and sharepoint trying to control this new ASP content.  I cannot figure out how to exclude this content from managed paths.

Any suggestions on how to resolve this issue so I can run this custom ASP file under sharepoint 3.0?


After login redirect to a desired page

Hi,   Just a simple question. After I click login button, I want to page be redirected to display.aspx. How to set up it? Sorry for the silly question.

How to set the variation root redirect page to ALWAYS go to a preset label?

Hi. I have setup variations and I have 4 labels, SE EN FI DK. This is a public website and I want every visitor to first be directed to the predetermined label, for example SE. This no matter what setting they have in their browser... In Sweden, most people have English as the language in the browser since this gets you better content in most places, but in this case, it gets them the EN label instead of the SE label as default. How can I change this in the best way possible? Are there any easily adaptable solutions available? Like on codeplex? The MSDN way is not to my liking, manually customize every front end or compile my own DLL....Noo, there has to be a better way right? (How to: Customize the Variations Label Control Logic http://msdn.microsoft.com/en-us/library/ms551625.aspx) Appreciate any help you can give me on this. RegardsThomas BalkestÃ¥hl - Technical Specialist - SharePoint

Adding source redirect code to end of a URL which used a dynamic data value

I'm trying to add some source redirect code to the end of a URL in a Data Form Web Part on a simple SharePoint aspx page. This is the basic url: /itservices/helpdesk/Lists/Service%20Requests/DispForm.aspx?ID={@ID} However I want to add a source redirect to the end of the URL so that it returns to a particular page rather than the list's default page. I have tried all of the following: /itservices/helpdesk/Lists/Service%20Requests/DispForm.aspx?ID={@ID}&source=/itservices/Pages/MyOverview.aspx That causes an error in the web part stating "This Web Part does not have a valid XSLT stylesheet: Error; A semi colon character was expected". I tried replacing the ampersand with the URL encoded character: /itservices/helpdesk/Lists/Service%20Requests/DispForm.aspx?ID={@ID}%26source=/itservices/Pages/MyOverview.aspx But when opening from this URL the form contains no data. What am I missing or can this not be done? Thanks.  

Profile page throwing an error after adding some "ask me about" tags

After adding some "ask me about" tags my profile page is throwing an error. To be more precise the AskMeAbout WebPart ist throwing a thread aborted exception and I don't understand the reason for this error. After removing the tags the sites works again. Some tags work but after trying some other tags the profile page is broken again. Unhandled exception caught during execution of Microsoft.SharePoint.Portal.PageBase::ErrorHandler(). Exception information: Exception information: Microsoft.SharePoint.WebPartPages.WebPartException: Thread was being aborted. ---> System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderValues(HtmlTextWriter writer, Int32 startIndex, Int32 endIndex) at Microsoft.SharePoint.Portal.WebControls.AskMeAboutWebPart.RenderWebPart(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.WebPart.Render(HtmlTextWriter writer) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) - -- End of inner exception stack trace --- at Microsoft.SharePoint.WebPartPages.SPChrome.RenderPartContents(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.SPChrome.RenderWebPart(HtmlTextWriter output, WebPart part) at Microsoft.SharePoint.WebPartPages.WebPartZone.RenderZoneCell(HtmlTex

Create buttons for "new item" which create a new page of a specific content type

We have a Pages library (wiki) which supports a few content types (and page layout associated). We want to enable users to click a button for example of "new custom enterprise wiki page" - so a new page of content type article will be open in edit mode. Can someone help how to develop? (it has to mimic the behavior that happens when user creates new page from the Ribbon or Site actions and has to choose the content type, it also has to keep the new page in edit mode and not just create it).  

Response.Redirect in C# for page to page parameter passing

Looking for examples of this, but can't find anything specific. I'm new to ASP.NET, and C# at the same time... so I'm struggling to get it right...  Thanks, Nick

Getting Selected Item in radiobuttonlist on content page using javascript

I am trying get the selected value from a radiobuttonlist on a content page using javascript. Here is my initial code, which does not recognize the control. The js is located in a separate file and there is a link on the content page pointing to the js file. Thanks, function GetRadioButtonValue() { var radio = document.getElementsByName('<%=rblPayType.ClientID%>'); for (var j = 0; j < radio.length; j++) { if (radio[4].checked) { alert(); return; } else { return; } } }    

Authentication required, redirect to login page

Hi,I want authentication required for all webpages in a site. If i copy the url of any of the web page in the current site and paste it in the url address i should redirect to login page. If you have any solution please suggest it.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend