Click here to Skip to main content
15,884,898 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: How to send email throw the website Pin
Christian Graus21-Oct-09 20:25
protectorChristian Graus21-Oct-09 20:25 
JokeRe: How to send email throw the website Pin
nagendrathecoder21-Oct-09 20:44
nagendrathecoder21-Oct-09 20:44 
GeneralRe: How to send email throw the website Pin
Christian Graus21-Oct-09 21:41
protectorChristian Graus21-Oct-09 21:41 
Questionresponse.redirect and visible panels Pin
widget121-Oct-09 16:56
widget121-Oct-09 16:56 
AnswerRe: response.redirect and visible panels Pin
RCoate21-Oct-09 17:19
RCoate21-Oct-09 17:19 
GeneralRe: response.redirect and visible panels Pin
widget122-Oct-09 2:19
widget122-Oct-09 2:19 
AnswerRe: response.redirect and visible panels Pin
Christian Graus21-Oct-09 20:26
protectorChristian Graus21-Oct-09 20:26 
QuestionHelp Passing Textbox value through ActionLink [modified] Pin
Jason Wilczak21-Oct-09 14:15
Jason Wilczak21-Oct-09 14:15 
Hello all!

Although I have followed Codeproject for awhile, this is my first post...from what I remember anyways. Smile | :)

Ok, so here's my issue, I am working on an Asp.net MVC page (C# is my language).
Everything is going well, however I need to pass some string values to my controller
to generate a search result page. Everything (logistically) works correctly.
The problem is that it is only drawing null values from the textboxes on the page and
passing them through the actionlink, through the routing table, to the controller action.
For the life of me, I cannot figure out why this is happening...so if someone could help
me out I would IMMENSELY appreciate it =D I'm going to post my page code now and hang
out with the wifey, I will check back periodically over the next day. Thanks in advance!!

This is the page
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Home
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <form id="form1" runat="server">

    <h2>Home</h2>
    <p>
    
        <asp:Table ID="Table1" runat="server">
            <asp:TableRow ID="rowDetails" runat="server">
                <asp:TableCell ID="cellDetails" runat="server" ColumnSpan="4">Welcome to the LumeTix Weekly Reporter!  Use the search below to locate and view or edit a Report.  Otherwise, click &quot;Create New&quot; to create a new report!</asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server" ColumnSpan="4">
                <%= Html.ActionLink("Create New", "Create") %>
                </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow runat="server">
                <asp:TableCell runat="server" ColumnSpan="1">Filter By Last Name:</asp:TableCell>
                <asp:TableCell runat="server" ColumnSpan="1">
                <asp:TextBox runat="server" ID="lastname" />
                </asp:TableCell><asp:TableCell runat="server" ColumnSpan="1">Filter By Date:</asp:TableCell><asp:TableCell runat="server" ColumnSpan="1">
                <asp:TextBox runat="server" ID="date" />
                </asp:TableCell></asp:TableRow><asp:TableRow runat="server">
                <asp:TableCell runat="server" ColumnSpan="4">
                <%=Html.ActionLink("Search!","Results", new { ln=lastname.Text , d=date.Text}) %>
                </asp:TableCell></asp:TableRow></asp:Table></p></form></asp:Content>


This is from my global file
public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Results",
                "{controller}/{action}/{lastname}/{date}",
                new { controller = "Home", action = "Results", ln = "", d = "" }
                );

            routes.MapRoute(
                "Default",                                              // Route name
                "{controller}/{action}/{id}",                           // URL with parameters
                new { controller = "Home", action = "Home", id = "" }  // Parameter defaults
            );

            

        }


and This is from my Controller
public ActionResult Results(string ln, string d)
       {
           Filter filter = new Filter();
           filter.Date = d;
           filter.LastName = ln;
           if (!ModelState.IsValid)

               return View();

           filter.SetFilters();
           return View(XMLFiler.ReportSearchResults(_db.reportSet.ToList(), filter));

       }


modified on Wednesday, October 21, 2009 8:36 PM

AnswerRe: Help Passing Textbox value through ActionLink Pin
Not Active21-Oct-09 14:43
mentorNot Active21-Oct-09 14:43 
GeneralRe: Help Passing Textbox value through ActionLink Pin
Jason Wilczak21-Oct-09 15:05
Jason Wilczak21-Oct-09 15:05 
QuestionWeb framework Pin
bam_usic21-Oct-09 13:30
bam_usic21-Oct-09 13:30 
AnswerRe: Web framework Pin
Abhijit Jana21-Oct-09 16:38
professionalAbhijit Jana21-Oct-09 16:38 
QuestionProblem with post back validation Pin
compninja2521-Oct-09 10:01
compninja2521-Oct-09 10:01 
AnswerRe: Problem with post back validation Pin
compninja2522-Oct-09 5:46
compninja2522-Oct-09 5:46 
QuestionHow to validate date using javascript Pin
dilipmca0421-Oct-09 7:53
dilipmca0421-Oct-09 7:53 
AnswerRe: How to validate date using javascript Pin
Abhijit Jana21-Oct-09 8:05
professionalAbhijit Jana21-Oct-09 8:05 
AnswerRe: How to validate date using javascript Pin
dan!sh 21-Oct-09 8:08
professional dan!sh 21-Oct-09 8:08 
QuestionCheckbox control in Gridview at runtime. Pin
Care Career21-Oct-09 5:28
Care Career21-Oct-09 5:28 
AnswerRe: Checkbox control in Gridview at runtime. Pin
dan!sh 21-Oct-09 5:34
professional dan!sh 21-Oct-09 5:34 
AnswerRe: Checkbox control in Gridview at runtime. Pin
Anurag Gandhi21-Oct-09 5:48
professionalAnurag Gandhi21-Oct-09 5:48 
Questionwebparts - catalog - referencing a single instance Pin
SteveBradwell21-Oct-09 4:05
SteveBradwell21-Oct-09 4:05 
QuestionHow to pass SoapHeader in .NET 2.0 for authentication to AXIS web service Pin
ajay_sp00221-Oct-09 3:18
ajay_sp00221-Oct-09 3:18 
AnswerRe: How to pass SoapHeader in .NET 2.0 for authentication to AXIS web service Pin
Not Active21-Oct-09 4:15
mentorNot Active21-Oct-09 4:15 
QuestionHow do I delete item on a Repeater control? Pin
tunsten21-Oct-09 3:08
tunsten21-Oct-09 3:08 
AnswerRe: How do I delete item on a Repeater control? Pin
Not Active21-Oct-09 4:14
mentorNot Active21-Oct-09 4:14 

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.