|
Hi,
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext context = HttpContext.Current;
if (context.Request.FilePath.ToString().StartsWith("/hotels-in-"))
{
context.RewritePath("country.aspx");
}
}
this is my code in global.asax.cs file
this code is working in local system but when i uploaded the project to server its not working what to do??........
please help me...thx
icanmakeiteasy
|
|
|
|
|
When you say that it's "not working", what do you mean? What happens, and how does that differ from what you expect? Do you get any error message?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
http://........../hotels-in-India //url is like this
Not Found
The requested document was not found on this server.
just its showing like this
icanmakeiteasy
|
|
|
|
|
You can only use url rewriting in the ASP.NET code if the request is handled by the ASP.NET engine. When you run it locally all requests are handled by the ASP.NET engine, but not on the server.
Change the url to one that is handled by the ASP.NET engine, change which extensions are handled by the ASP.NET engine, or use a url rewriting component.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thx for reply ...
then let me know how to use url rewriting component
icanmakeiteasy
|
|
|
|
|
That depends entirely on what component you choose. Instructions for installation and usage will be included with the component.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Im having almost exactly the same issue as this OP. Ive developed a url rewriting "component" of sorts which uses the same method as this poster has decribed HttpContext.RewriteUrl method.
When developed on my local machine with the VS web server its working fine. When I upload to Win 2008 Server all that happens is a 404. Its one of those rare cases where "not working" is about as much as you have to go on
My solution will be to add lots of tracing to the code and enable it on the liove server to determine what is going wrong.
|
|
|
|
|
Have you sorted it? Windows 2008 has IIS7.0, right? It needs HttpHandlers and Modules to be configured explicitly.
|
|
|
|
|
No ive not sorted it, and ive not got to grips with the intricacy of win 2008 server yet. So thanks for the pointer...i'll check that out now!
|
|
|
|
|
HI,
I have an array of type TreeNode. I used Contains() to check existence of one particular node in Treenode[].
TreeNode selNode = treeView1.SelectedNode;
TreeNode[] ad = treeView2.Nodes[i].Nodes.Find(selNode.Name,false);
bool result = ad.Contains(selNode);
result is always false, eventhough ad contains selNode. Please let me know how to make it work.
Thanks in advance.
|
|
|
|
|
Please do not repost questions. If you didn't get an answer the first time, you are unlikely to get one now.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Lalitha Agnes wrote: TreeNode[] ad = treeView2.Nodes[i].Nodes.Find(selNode.Name,false);
Are you sure the code works ?
Lalitha Agnes wrote: eventhough ad contains selNode
Why do you say that ? From the code, selNode is from treeView1 and you are searching it in treeView2?
If you are trying to search a node from one tree to other,you could so something like this,
TreeNode selNode = treeView1.SelectedNode;
TreeNode[] ad = treeView2.Nodes[0].Nodes.Find(selNode.Name,false);
if (null != ad && 0 < ad.Length)
{
}
else
{
}
|
|
|
|
|
Thank you for your reply.
The code sent by you allows the duplicate childs for one parent node.
|
|
|
|
|
Lalitha Agnes wrote: duplicate childs for one parent node.
The selected node is from treeView1 and the code searches in treeView2. treeView1 and treeView2 are two seperate nodes.
Your orginal question was, Lalitha Agnes wrote: I have an array of type TreeNode. I used Contains() to check existence of one particular node in Treenode[]."
the code i sent you searches for the given node from the array of nodes.
|
|
|
|
|
Hi All!
How to get the opened applications details and log them
Username, Application Name, Openend time, Closed time, Work time, Idle time and the application usage time
Help me to get
Applicaiton Usage Time - The total time, the application was opened (regardless of the number of time opened and closed)
Work Time (The total time the app was in focus)
Idle Time (The total time the app was out of focus)
Answer me as early as possible...
|
|
|
|
|
Judging from the subject line of your post, you seem to think that you need to use the Windows API. Therefore I suggest that you check out pinvoke.com to see if it helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
I have used the XMLTextReader class to display the string, stored in a XML file
( "C:\Windows\system32"...) in a listbox control...i want to bind this string to a DataGridViewTextBoxColumn named Path....
How can i do this?Please help me with this..Thanks for any help in advance
|
|
|
|
|
Have you tried googling for 'DataGridViewTextBoxColumn AND DataBinding'?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ya in all examples a database has been created from which data
is bound to the DataGridTextBoxColumn...
I have not created any database....How should i proceed?
|
|
|
|
|
If you don't want to use DataSet/DataTable etc. Look up 'bind object to datagridview'.
Play around with the code from the results that you get and come back with any specific problem that you have with code you have written in trying to resolve your problem.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You can do something like this
DataSet ds = new DataSet();
ds.ReadXml("XML File Path");
DataColumn colPK= ds.Tables["tablename"].Columns["PKColumn"];
datagrid1.DataSource = ds;
datagrid1.DataBind();
You can design the datagrid to bind the values as required. if you want to add the fields in listbox
int i=ds.Tables["tablename"].Rows.count
int j;
for(j=0;j<i;j++)>
{
listbox.item.add(ds.Tables["tablename"].Rows[j]["colname"]);
}
syntax may not be correct. check into it...
|
|
|
|
|
How to handle prgress of FTP file transfer
Is it possible to resume the file transfer, after it is interupted
I am using FtpWebRequest/FtpWebResponse for handling ftp operations
Regards,
Radhakrishnan
|
|
|
|
|
I'd like to log some certain incoming sms to a form and I've came out with this code.
if (parent.checkBoxReplySMS.Checked)<br />
{<br />
SmsMessage msg = new SmsMessage(request.From.Address, parent.textBoxMessage.Text);<br />
<br />
msg.Send();<br />
<br />
parent.documentSms.AppendFormat(@"Body: {0}<br />", request.Body);<br />
parent.documentSms.AppendFormat(@"Name: {0}<br />", request.From.Name);<br />
parent.documentSms.AppendFormat(@"Address: {0}<br />", request.From.Address);<br />
parent.documentSms.AppendFormat(@"Last Modified: {0}<br />", request.LastModified);<br />
parent.documentSms.AppendFormat(@"Received: {0}<br />", request.Received);<br />
parent.documentSms.Append(@"<br />");<br />
<br />
}
But the problem is, if I want to clear the log, the code will erase all incoming sms which have been logged. What I want to do is, I can click the message and just delete that sms, not all.
Do you have any idea?
|
|
|
|
|
Depends on how you store them. If you use a DB, that would be easiest to manage. Otherwise, do you have a message id you can use, then you could use XML to store it all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I am developing website using C# with ASP.net.
one page I am inserting data into hashtable after reach 1000(>1000),Add it into Array list than Insert into Database...here sometimes saying Exception like
Item has already been added. Key in dictionary: '12' Key being added: '12'
...Please help me with this.....How to avoid this Eception...
and I am using following code..
public static Hashtable ht = new Hashtable();
public string Crid="";
Crid = ht.Count.ToString();
string[] st = new string[4];
st[0] = Crid;
st[1] = "5654546456";
st[2] = "0";
st[3] = "1";
if (ht.Count<1000)
{
ht.Add(ht.Count, st);
}
else
{
ArrayList list = new ArrayList();
foreach (int key in ht.Keys)
{
list.Add(ht[key]);
}
ht.Clear();
ht = new Hashtable();
ht.Add(ht.Count, st);
for (int j = 0; j < list.Count; j++)
{
//here Inserting data into Database
}
}
Raaj
|
|
|
|