|
Aloha,
I'm porting a Wordpress (Linux blog/CMS) based system to ASP.NET. Many of the articles in Wordpress have URLs like www.domain.com/santa-claus.
How do I handle requests to such URLs in ASP.NET. We have ported the data, but our ASP.NET pages have URLs like www.domain.com/article?id=234
I'm considering implementing an IHttpHandler that transforms the requests with the help of a database query (table with Wordpress/ASP.NET matches).
Is that the correct thing to do?
Thank you, Mads
|
|
|
|
|
|
Great, thanks. I'll definately take a look at that one.
Currently my attempt looks like this (no IHttpHandler stuff), it works, but there might be a best practice I don't know about...
<br />
protected void Application_BeginRequest(Object sender, EventArgs e)<br />
{<br />
string requestPath = HttpContext.Current.Request.Path.ToLower(); <br />
if (string.IsNullOrEmpty(requestPath) == false)<br />
{<br />
if (requestPath.Contains(".aspx") == false)<br />
{<br />
int accountItemId = <Database Call><br />
if (accountItemId > 0)<br />
{<br />
string convertedPath = "Article?Id=" + accountItemId.ToString();<br />
HttpContext.Current.RewritePath(convertedPath);<br />
}<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hello Friends.
I think this is one of the most innovative and challenging tasks I have ever encountered in my career.
I want to incorporate the Link Grammer open source project for the Open Source WordNet Dictionary.
Link Grammer:
http://bobo.link.cs.cmu.edu/link/index.html[^]
Wordnet:
http://wordnet.princeton.edu/[^]
The Link grammer project is available as a C code+ VC++ code + a API in C# as a console application.
Can anybody help me about this.
Thank You.
|
|
|
|
|
I want to export data from a table(sql) to a CSV file, using asp.net.
Thanks in advance,
Suresh Dayma
|
|
|
|
|
|
Thanks for the Reply.
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
Dear all
i'm using a session variable in my application and it's workin fine for some time and if i leave the page for a while the session expires
what i need is to expire the session only when the user closes the browed
(i don't want to set the session timeout to a specific time duration)
how can i implement that?
Best Regards
3ala2
|
|
|
|
|
Make the page request something periodically from the server, so that the session does not time out while the page is open. You can for example use a Javascript to request a small image at a certain interval.
You have to have a timeout on the session, or the server will fill up with old unused session objects.
---
b { font-weight: normal; }
|
|
|
|
|
can u give me an example?
and i think that there is a default timeout for the sessions, right?
i mean why does it disapear after a while without using the page.
I'll try to do the refresh function and c what happens
Thanx for ur response
Best Regards
3ala2
|
|
|
|
|
just3ala2 wrote: i think that there is a default timeout for the sessions, right?
Yes. The default timeout is 20 minutes.
---
b { font-weight: normal; }
|
|
|
|
|
Default Timeout is 20 seconds.
You can have a hidden IFRAME with a page like pingserver.aspx which would have a META Httpequiv TAG to the server.
Or without IFRAMES, you can have a JavaScript Timer and send a AJAX request to the server.
|
|
|
|
|
Type the following code, in the logout(link) button event.
Session.Clear()
Response.Redirect("Login.aspx")
Regards,
Suresh Dayma
Everything Is Possible!
|
|
|
|
|
HI..
Suppose I have two application A and B. I want to redirect from one page of application A to one page of application B along with some variables. how can I do this?.. plz help me..
Gurudatta B. Shelke
|
|
|
|
|
You can pass a value in form a Query string to other application like,
You can place the value inside the session from one application to the other application,This solution will be workable only if these two apps share a common session, means same server
If this two application is in different server then try this,
http://ServerName/AliasName/FileName.aspx?name=value, just pass the value as a query string
Mohan
|
|
|
|
|
Thanks for Your guidance
but How can i access session variable of one application in other application
Gurudatta B. Shelke
|
|
|
|
|
If you passed the varaible as:
http://ServerName/AliasName/FileName.aspx?name=value
Then, in C# you could access the variable 'name' as:
Request["name"]
This returns the string 'value' (always a string!!!)
The best times in life are the ones you can't remember!!!
|
|
|
|
|
Sorry, I was referring to accessing the query string varaibles. I don't think there is any way to access session variables across web applications. ASP.NET registers the session variables with the application so each application has it's own variables.
I just use query strings cause it's easier.
The best times in life are the ones you can't remember!!!
|
|
|
|
|
Hi,
I have one work around for this,
Any have this applications (A & B) are gonna be available on the same server and share the same machin.config file, So what you can do is add a new key and have some default value set for the key and during runtime set the value for that key from Application 'A' and access the same from the Application 'B' ensure there is no default value so that you can get the value set by the Application 'A'
Mohan
|
|
|
|
|
The second work around is:
1) Have a common helper class in the Application class that should be a static singleton class and define the attributes according to your requirement(s) in the class
2) Set the value in the respective variable of that class(Singleton) from Application 'A'
3) Add the refernce of the application in Applicatin 'B' and include the namespace and access call the custom method(has to be defined in the Singleton class of app 'A') that inturn returns the required value also it is persist accross applications
I'm sure this would be the appropriate solution
Mohan
|
|
|
|
|
Form Posting should be more safe, secure and reliable.
|
|
|
|
|
Hi,
Can you guide me how to create a XSD schema in VS 2005 adhearing webservice as a source for the schema?
From the Visual Studio 2005, I can able to create a new XSD from the New Item dialog box, but I culd not able to proceed to create a XSD for a webservice? Please give me the solutin for this?
Thanks in advance
Mohan
|
|
|
|
|
Hi Dear All,
"Having problem in making of website in ASP.NET using C#.NET with MS-Access"
I having problem with textbox
I want to add date in textbox in date formate
what should i do?
like. Date is 12/11/2006 i want directly add date in textbox The TextBox should Look Like
" __/__/____" and also Time for TextBox " _ _:_ _ p.m."
I hope u understand
please reply me as soon as possible
Thanks,
Vipul
Vipul
|
|
|
|
|
http://www.cnblogs.com/codingcow/archive/2006/07/23/113339.html
TextBox1.Text = DateTime.Now.ToString("MM/dd/yyyy");
TextBox1.Text = DateTime.Now.ToString("hh:mm tt");
|
|
|
|
|
Thanks
Dear
But Dear I dont want coding format I want in design time disply when i run my web application my TEXTBOX should LOOK LIKE "__/__/____" and Time will be "__:__" on Textbox
{If u know the VB 6.0, MaskedBox Control is there for date/time/etc.,,}
and when i entered my date my TextBox should Look Like as a "12/12/2006" and Time "12:00"
I think u understood very well
Please reply ASAP.
Thanks
Vipul
Vipul
|
|
|
|