|
Response.RedirectParmanent is an extension function introduced in .NET 4.0.
The main motive of it is to indicate the Response Code to the Search Engine that the page is moved permanently. The Response.Redirect generates Response code as 302 whereas RedirectParmanent returns 301.
Thus say you have a page, and which is included to search engine for a long time, if you use Response.Redirect() it will not change this effect to the search engine(taking this a temporary change), while if you use Response.RedirectParmanent() it will take it as permanent.
In case of Server.Transfer() the actual response is actually been updated. There is no effect to the search engine, and search engine will think the output is coming from the same page that is called upon. Let us give an example :
Say you have 2 pages (Page 1 and Page 2) where Page1 redirects to Page2
In case of
1. Response.Redirect() : Search Engine will take this redirection as Temporary(Status 301) and always keep Page1 in its cache.
2. Response.RedirectParmanent() : Search Engine will take this a permanent redirection(Status 302) and will remove Page1 from its database and include Page2 for better performance on search.
3. Server.Transfer() : Search Engine will be unaware of any redirection been took place (Status 200) and will keep Page1 to its database. It will think Page1 is producing the output response of Page2.
When to use:
Response.Redirect is perfect when your page is temporarily changed and will be changed to original within a short span of time.
Response.RedirectParmanent() when you are thinking of deleting the Page1 totally after the search engines changes its cache.
Server.Transfer() when you are thinking of keeping the page for ever, and to let search engine unaware of this redirection.
|
|
|
|
|
nice one.
|
|
|
|
|
Good Explanation Abhishek !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi abhishek,it is so clear for me. thank you so much my friend.
fttyhtrhyfytrytrysetyetytesystryrty
|
|
|
|
|
I am not abhishek , Anyway, Abhishek will read the message
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thank you so much for your appreciation.
Cheers.
|
|
|
|
|
See how it works in ASPNEt4
http://himabinduvejella.blogspot.com/2010/01/aspnet-40-working-with-redirect.html
You don't need to compare it with Server.Transfer. If you understand the feature. It's SEO feature
Iblog
"If you can dream IT, you can become IT"
|
|
|
|
|
Hi All,
My URL has '&' so its giving bad request so plz tell me how to handle it.
Thanks
|
|
|
|
|
A '&' is a special character within a url, defining an additional key-value-pair within the query string. Could you post the Url and where you use it (Response.Redirect in ASP.NET etc.)
Regards
Sebastian
|
|
|
|
|
Add %26 instead of & in the querystring.
Or Use this to facilitate them automatically:
In case of you are calling from Server use Server.URLEncode(value) and Server.URLDecode(querystring)
If you are passing through Javascript use :
encodeURIComponent(value)
Hope you can get it solved now.
|
|
|
|
|
Hi,
There is one utility called SQLBULKCOPY but that is for sqlserver.
In asp.net 2.0, there is no as such utility for oracle.
My need is to transfer excel data to oracle?
Provide any solution.
|
|
|
|
|
|
I have opned an oledb connection to connect to oracle.
I am working in offline mode.
I fill up the dataset with excel data. Works fine.
Now I open oracle connection with oledb only.
Created oracle adpater also using oledbadapter.
Created the dataset. it contains no rows as table in oracle is empty.
Check the code below:
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0";
OleDbConnection oledbConn = new OleDbConnection(connString);
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
DataSet ds = new DataSet();
oleda.Fill(ds, "Sheet1");
OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123");
OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1);
OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
oledb.Fill(ds1, "excel_ora");
ds1 = ds.Copy();
OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb);
oledb.Update(ds1,"excel_ora");
//the above line thorws error as it does not find table "excel_ora"
Response.Write("hi");
|
|
|
|
|
//Code related to excel
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0";
OleDbConnection oledbConn = new OleDbConnection(connString);
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
DataSet ds = new DataSet();
oleda.Fill(ds, "excel_ora");
//Code related to Oracle
OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123");
OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1);
OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
oledb.Fill(ds1, "excel_ora");
//Transfer excel dataset to oracle
ds1 = ds.Copy();
OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb);
oledb.Update(ds1,"excel_ora");
Response.Write("hi");
-----------------------------------------------
Written aboce code. everything fine but data does not transfer to oracle. WHy?
|
|
|
|
|
|
I think asp.net 2.0 does not support this. I tried but not working.
|
|
|
|
|
Hi Friends,
i develop a website using asp.net it work perfectly when i run my application from VS2008.But i want my website as published one ie i want my application to run without VS2008 support.How i publish that and run in IIS Server. please help with your valuable ideas.
regards
Vasanth.A
|
|
|
|
|
Google suggested me all these [^]articles to do this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Publish your website.Add a virtual directory in your IIS and target it to the published content.
|
|
|
|
|
|
On some sites like yahoo mail when you right click it seems to override the default webbrowser right click menu and show its own html type menu. How do they do this? Im presuming its some javascript ninja'ing?
BTW i put this in the ASP.NET board because I will be doing on an ASP.NET site.
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
Hi all,
Im getting a soap response from a server. the xml looks like:
<?xml version="1.0" ?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <TN_DetailsResp xmlns="http://tempuri.org/">
<PersNr>2</PersNr>
<ProjCode>2</ProjCode>
<CardNr>2</CardNr>
</TN_DetailsResp>
</soap:Body>
</soap:Envelope>
How can i get a single element and display it in a label.
For example how to show the value of 'PersNr' in a label. Im using C#
|
|
|
|
|
This is so basic. You should go to Google and sreach for 'Read xml + c#'.
If you do not understand even after that, come back and show us what have you done. Some one would help you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Are you going to make a Soap Response Parser?
I think .NET automatically creates them for you.
You need to Add Web Reference to your project and you will get everything as an Object.
|
|
|
|
|
Piya B wrote: How can i get a single element and display it in a label.
You can do that with XPath *easily*. Load the XML to a XmlDocument class work with SelectSingleNode() method.
string xPath = "/soap:Envelope/soap:Body/dummy:TN_DetailsResp/dummy:PersNr";
XmlDocument document = new XmlDocument();
document.Load("your_xml");
XmlNamespaceManager nm = new XmlNamespaceManager(document.NameTable);
nm.AddNamespace("dummy", "http://tempuri.org/");
nm.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
XmlNode node = document.SelectSingleNode(xPath, nm);
string result = node.InnerText; XPath is bit tricky here as your XML involves namespaces. dummy is a namespace prefix which I introduced as TN_DetailsResp node doesn't have any prefix.
Hope that helps.
|
|
|
|