Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
adding a parameter to pass to asp.net mvc controller
18/03/2010
23:38
Avatar
twaldron
Member
Members
Forum Posts: 3
Member Since:
19/03/2010
sp_UserOfflineSmall Offline

I have this a controller  like this

  public ActionResut GetJsonData(DateTime date, string sidx, string sord, int page, int rows)

{

....

}

how do I pass that date parameter to the controller from jqgrid?

here is my jqgrid

<script type="text/javascript">
            var id = Date.parse('today');
            
            jQuery(document).ready(function() {
                jQuery("#ScheduledList").jqGrid({
                url: 'DealerServices/JsonScheduledSpas/',
                    datatype: 'json',
                    mtype: 'GET',
                    colNames: ['Invoice', 'Company', 'Contact', 'Model', 'Customer', 'DSR'],
                    colModel: [
                         { name: 'invoice', index: 'invoice', width: 50, align: 'left' },
                         { name: 'company', index: 'company', width: 200, align: 'left' },
                         { name: 'companyContactNumber', index: 'companyContactNumber', width: 100, align: 'left' },
                         { name: 'descript', index: 'descript', width: 60, align: 'left' },
                         { name: 'CustomerName', index: 'CustomerName', width: 130, align: 'left' },
                         { name: 'DsrFirstName', index: 'DsrFirstName', width: 70, align: 'left' }
                    ],
                    pager: jQuery('#Scheduledpager'),
                    rowNum: 10,
                    rowList: [5, 10, 20, 50],
                    sortname: 'Id',
                    sortorder: "desc",
                    viewrecords: true,
                    imgpath: '../../../../Content/CSS/startTheme/Images/',
                    height: '250px'
                });
            });
            
        </script>

How do I get that date variable passed to the controller?

[code]

19/03/2010
02:20
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello twaldron,

if you really want to have date as a parameter of your conctoller, then you need at least modify url parameter of the jqGrid from

"DealerServices/JsonScheduledSpas/" to some with the date inside of url. Then you need add coresponding template in you MVC application which difines from which part of url the date should be fiiled.

Best regards

Oleg

19/03/2010
17:20
Avatar
twaldron
Member
Members
Forum Posts: 3
Member Since:
19/03/2010
sp_UserOfflineSmall Offline

OlegK said:

Hello twaldron,

if you really want to have date as a parameter of your conctoller, then you need at least modify url parameter of the jqGrid from

"DealerServices/JsonScheduledSpas/" to some with the date inside of url. Then you need add coresponding template in you MVC application which difines from which part of url the date should be fiiled.

Best regards

Oleg


Right, thats exactly what I am asking. How do I do that?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
35 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information