Click here to Skip to main content
15,887,585 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: create customise gridview with search option Pin
ZurdoDev15-Dec-15 1:07
professionalZurdoDev15-Dec-15 1:07 
NewsAbout Developement project . and please help me. Pin
Member 1165639913-Dec-15 20:38
Member 1165639913-Dec-15 20:38 
GeneralRe: About Developement project . and please help me. Pin
JHizzle15-Dec-15 6:04
JHizzle15-Dec-15 6:04 
GeneralRe: About Developement project . and please help me. Pin
User 418025420-Dec-15 15:52
User 418025420-Dec-15 15:52 
QuestionHow To Show A Message Or Page On Clicking Url Link Before Redirecting To An External page Pin
hm911-Dec-15 10:29
hm911-Dec-15 10:29 
AnswerRe: How To Show A Message Or Page On Clicking Url Link Before Redirecting To An External page Pin
JHizzle15-Dec-15 6:10
JHizzle15-Dec-15 6:10 
QuestionCalling controller action method without passing parameter as query string MVC Pin
indian14311-Dec-15 9:04
indian14311-Dec-15 9:04 
AnswerRe: Calling controller action method without passing parameter as query string MVC Pin
Afzaal Ahmad Zeeshan13-Dec-15 21:14
professionalAfzaal Ahmad Zeeshan13-Dec-15 21:14 
Yes, make the ID parameter as an optional parameter. By default, the ID parameter is always optional in ASP.NET routing provided in the template.

Secondly, if you would not pass it as a query parameter (URL parameter), you would need to pass it as a form encoded object, much like a POST HTTP request. Then, you would still be able to get the value of ID. But if you do not pass it, how would you know which ID to use to show the details?

Browser doesn't execute the method, it is your server that does! So the function is executed on your server-side, the URL is just required to map the request to a response.
C#
class Employee : Controller
{
   public ActionResult GetEmployee(int? id) {
      // In this function "id" is nullable. 
   }
}
But much recommended way is to design your routing in such a way, to have ID optional.
C#
routes.MapRoute(
    name: "EmployeeRoute",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Employee", action = "GetEmployee", id = UrlParameter.Optional });
This is much better way of doing this!
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

AnswerRe: Calling controller action method without passing parameter as query string MVC Pin
F-ES Sitecore13-Dec-15 22:56
professionalF-ES Sitecore13-Dec-15 22:56 
Questionhow to host asp.net website Pin
Member 1216284511-Dec-15 1:10
Member 1216284511-Dec-15 1:10 
AnswerRe: how to host asp.net website Pin
Richard MacCutchan11-Dec-15 2:09
mveRichard MacCutchan11-Dec-15 2:09 
AnswerRe: how to host asp.net website Pin
F-ES Sitecore11-Dec-15 2:27
professionalF-ES Sitecore11-Dec-15 2:27 
QuestionFLUX Pin
L Viljoen10-Dec-15 22:43
professionalL Viljoen10-Dec-15 22:43 
AnswerRe: FLUX Pin
Richard MacCutchan11-Dec-15 2:08
mveRichard MacCutchan11-Dec-15 2:08 
GeneralRe: FLUX Pin
L Viljoen14-Dec-15 20:35
professionalL Viljoen14-Dec-15 20:35 
Questionhosting aspx page as a domain Pin
Member 119197229-Dec-15 20:18
Member 119197229-Dec-15 20:18 
AnswerRe: hosting aspx page as a domain Pin
Wombaticus9-Dec-15 22:54
Wombaticus9-Dec-15 22:54 
GeneralRe: hosting aspx page as a domain Pin
Member 1191972210-Dec-15 17:51
Member 1191972210-Dec-15 17:51 
GeneralRe: hosting aspx page as a domain Pin
Member 1191972210-Dec-15 20:22
Member 1191972210-Dec-15 20:22 
QuestionPopulate a Dropdown list based on another one in VB.NET Pin
hm97-Dec-15 5:20
hm97-Dec-15 5:20 
AnswerRe: Populate a Dropdown list based on another one in VB.NET Pin
Md. Marufuzzaman8-Dec-15 3:47
professionalMd. Marufuzzaman8-Dec-15 3:47 
Questionsql query with an alias having space in asp.net code behind Pin
Member 119197226-Dec-15 22:24
Member 119197226-Dec-15 22:24 
AnswerRe: sql query with an alias having space in asp.net code behind Pin
F-ES Sitecore6-Dec-15 22:34
professionalF-ES Sitecore6-Dec-15 22:34 
Questionproduct Photos are getting stretched when uploaded. Pin
S S.Afsar6-Dec-15 5:30
S S.Afsar6-Dec-15 5:30 
SuggestionRe: product Photos are getting stretched when uploaded. Pin
Richard MacCutchan6-Dec-15 6:04
mveRichard MacCutchan6-Dec-15 6:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.