TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jov c
NA
13
1.3k
create url routing in global.asax with jquery query string
May 3 2019 4:44 AM
i tried url routing using global.asax..its working for home.aspx..but not working for Details.aspx?name=jo having querystring...
void
Application_Start(
object
sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
public
void
RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute(
"Home"
,
"Home"
,
"~/Home3.aspx"
);
routes.MapPageRoute(
"Details"
,
"Details{name}"
,
"~/Details.aspx"
);
//error
}
my url changed from http://localhost:34345/Home3.aspx to http://localhost:34345/Home ..
i use jquery ajax in my project...here data is passed through query string for details.aspx using jquery... so while using global.asax,i cannot read data from query string..i am getting an error.. ... here is the query string code page1
$(
"#btnsubmit"
).click(
function
() {
var
Textdata = $(
'#txtdata'
).val();
var
url =
"Details?name="
+ encodeURIComponent(Textdata);
window.location.href = url;
});
Details.aspx..
function
getdealsearch() {
var
name = window.location.search.split(
'='
)[1] == undefined ?
''
: window.location.search.split(
'='
)[1];
$.ajax({
type:
"POST"
,
url:
"/WebService.asmx/Getbyname"
,
data:
'{Name:"'
+ name+
'"}'
,
contentType:
"application/json; charset=utf-8"
,
dataType:
"json"
,
.....
....
......
}
when added Details.aspx to global.asax ..i am getting an error as HTTP Error 404.0 - Not Found ...and the the link shown is http://localhost:56105/Details?name=jo how can i convert the link to http://localhost:56105/Details/jo..plese reply..thanks in advance
Reply
Answers (
1
)
PDF File Copy FTP to local Folder
I Want to Write nunit testcases ,i wroted but later want log