redirecting a page from asp to aspx - asp.net

I was assigned a project I'm having some difficulty finding a solution or guide to, we have a asp shopping cart that currently runs in a classic asp page, we want to redirect once they click "checkout" to redirect to our newer aspx page.
any help is greatly appreciated.
edit:
I have tried to simply do a redirect to the website giving it the information that it needs like order id, date, etc. however this method gives me an error with the web.config on the asp side. involving our target framework 4.5.2.
I am extremely new to web programming and this is my first non fix bug x issue.

If I understood your question correctly, you just need to put your destination page address in your action parameter in the original page <form> tag.
<form action="./destination_page.aspx">
<!-- page content -->
</form>

Related

update redirection ASP .net

I a problem with my site..
There is a logo in my site thats redirect to the Home page.
The problem is that if for example i'm in page www.domain.com/about and I press the logo - everything fine and it goes to www.domain.com/Main, but if i'm in page www.domain.com/page/125 It's redirect me to www.domain.com/page/Main instead of www.domain.com/Main.
I have all the site files. which file I should change?
Is it the sitemap?
(I have no page name page or 125...)
Thanks!
Without knowing how your project is structured or if you're using WebForms or MVC, it's difficult for the StackOverflow community to help you. Please update your question with more details if the below suggestion doesn't help or apply.
If you're using using WebForms with MasterPage and content pages, the logo is usually in the MasterPage e.g. Site.Master
Try and find something like this in your Site.Master
<img src="logo.gif"/>
and replace it with this
<img src="logo.gif"/>
or this
<a runat="server" href="Main"><img src="logo.gif"/></a>

Writing a URL in webforms

I have inherited a project written in .net webforms, basically just an old site that needed to be skinned/made responsive. All of that is done and functions as it should. However I noticed that the old version of the site didn't contain a 404 page, something that I feel is necessary for this site. I've made a 404 page but what I want to do is display the URL on the page. So it'd be something like
<div>
<h1>Something went wrong with</h1>
<h2>Page URL here</h2>
</div>
I know in MVC.net you can write http://www.domainname.com#(Request.QueryString["aspxerrorpath"]
but whats the equivalent in webforms?
FYI the "backend" of each page is written in VB
Thanks in advance
I originally misread your question and advised Server Variables for "URL", then realised you're on a custom error page, so it would just show the URL you're on.
Perhaps you can use the Referring page?
<%=Request.ServerVariables["HTTP_REFERER"]%>
Additional info
ASP.NET aspxerrorpath in URL

Add-ons or libraries for adding user comment functionality to an existing ASP.NET page?

I have an ASP.NET site which I'd like to add page-level comments to without having to change everything over to a blog/CMS platform like BlogEngine.net, Wordpress, Umbraco, etc. Does anyone know of an add-on or library, either free or for-purchase, which can be added to certain ASPX pages to enable a stream of user comments at the end of the page?
The rest of the ASPX page needs to be able to have ASP.NET form controls, jquery and in some cases postback functionality I've written specific to the page which is why a simple blogging page is not enough as it means the blog engine owns the page aside from static content the site owner can enter.
Ideally there would be a way I could add a code snippet or user control to each ASPX page where I wanted comments and then they would show up and be managed independently on each page. I'd like to have the ability for users who post comments to be emailed when additional comments or replies are posted to their comment.
I am currently not locked into a particular authentication method so that is not necessarily a limiting factor.
This seems fun, I've not used it yet so I can't say if it works well or not.
http://developers.facebook.com/news.php?blog=1&story=198

Asp.net Login Control

I have a web application that I use Login Control and ASP.net membership for Sign in process.
my application work propebly untill last week I upload new version, in this version I didnt change the login UC and just the main page ( default page after user logged in ) changed.
but some users report me they cant login and redirect to Login page.
some note:
1- this problem occure just in IE browser
2- users that report this problem can login to old version
I add a log procedure and see users redirected becuase of this code
if (!this.User.Identity.IsAuthenticated)
{
Response.Redirect("~/Secure/Signin.aspx");
}
I checked and see this.User.Identity.Name was empty or null.
What setting maybe changed?
Thanks
I've seen a similar thing happen when there was a malformed FORM tag was rendered inside my ASP.Net Server FORM tag. By 'malformed' I mean that it was missing the required METHOD attribute.
It is my understanding that the HTML spec doesn't support nested FORM tags, so different browsers handle them differently. In my case, I saw a similar issue as you describe, with no issues in Firefox, and major issues in IE.
Check to ensure there are no Nested FORM tags on your page. Also check all FORM tags to ensure they have all required attributes.
Doubt this will solve the problem, it's kind of tangental. But, rather than hand coding the redirect url it's poosible to use
FormsAuthentication.RedirectToLoginPage()
which has the benefit of taking care of the returnUrl and stuff. It'd require the login Url set in the web.config.

Making a static ASP.NET site which has 100+ pages

I am converting an old html based website to ASP.NET, so that we can include more features like AJAX, Databases later on to the site. Currently my task is to create a new .aspx page for each older html page. To keep the layout persistent i have made a master page.
So currently i am building a content page from the master page, then renaming the content page and adding the text from the html page to the content placeholder area. However i was wondering if can cannot write a system, which can act as a Page Thrower.
Each hyperlink when clicked goes to a serverside code, where it requests the page it wants to load. Typically a webserver expects that the pagelink specified in the hyperlink does exist physically, but here what i am trying to do is that. Say the link is for the page "TravelDetails", the page need not exist physically, but the content of it is present in a file in (html format). so the Page Thrower gathers the data to display for that page, it has a master page already, it adds the html of it there and then throws the custom page. This way i don't have to keep 100+ aspx pages, i can do with a single page and maintain another data structure to store the content (static data) for each page. any guidance if my approach is right, and how to go about it?
Thanks
I think you should try some cms avaialable in market like dotnetnuke. Because every time you need to have to create a web page for a html page. In future if there will be any changes then it will take time. While in cms like dotnetnuke you just need to paste your html in existing system. You don't need to do coding again.
DotNetNuke is a free one. There are other Content Management System also available as well. Another advantage is that dotnetnuke is having skin features. So if you change skin at one place. You need not to do it for all the places.
Take a look at ASP.NET MVC. It uses ASP.NET Routing, which may help you.
Alternatively you can use ASP.NET Routing without MVC, too.
Matthias
Just a thought.
Create a page linked to the Master Page. In the content place holder add a Panel.
Let your Page thrower decide which page to display, retrieve the html data & add it to the panel at runtime.
Why don't you create the pages dynamically and then use asp.net caching in order to increase throughput.

Resources