.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to add parameter dynamically in jquery & passed it to controller.

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
my code is like -$("#SelectedIds").val(selectedCheckBox); //i get the ids of selected checkbox here var ss = $("#SelectedIds").val(); // i pass all the ids in a variable var xx= "<%= Url.Action("GetAssignToRequestUrl", "PlanRequest", new { selectedItems = "ss" }) %>"; window.open(xx,"ss",'width=1000px, height=700px'); window.focus(); so in this line i am passing "ss".but in my controller i didnot get the value in a parameter variable, instead i am getting ss as parameter, not the selected ids.how can i do that.Plz help.

View Complete Post

More Related Resource Links

jquery webservice with parameter

how to call web service with jquery in asp.net with param valuethanks in advance

change sub menu position dynamically using jquery



I have created horizontal menu like below...

<!--<ul id="topnav">
    <li><a href="#">Link 1</a></li>
    <li><a href="#">Link 2</a></li>
        <a href="#">Link 4</a>
            <a href="#">Subnav Link</a> |
            <a href="#">Subnav Link</a> |
            <a href="#">Subnav Link</a>
    <li><a href="#">Link 3</a></li>

problem is in my css i assigned margin-left:0px  for span.so all my sub navs align to left.but i want to align sub nav under the mail nav.means i need to change align-left property of css dynamically using jquery.

means first sub nav link should be below 'link4' not under 'link1'

so i added fol

jquery how to loop through dynamically created controls


I'm trying to use the following loop to loop through dynamically created controls on my web form:

                for(x = 0; x <= count; x++) {
                    Stmt += $("#DDLColumns" + x).val();
                    switch($("#DDLConditional" + x).val()) {
                        case "is equal": Stmt += " = ";
                        case "begins with": Stmt += " LIKE '%";
                    Stmt += $(&q

JQuery & dynamically instantiated User control



I have one problem which needs to be resolved immediately. I am using JQuery Datatable (http://www.datatables.net/).

This JQuery datatable is present in one of my webuser control named "LeftVerticalLayOut.ascx". I am dynamically instantiating Webusercontrol on click of a link button. This link button is bound with the trigger event of Update Panel control.

So clarifying once again : I have one UpdatePanel which I am triggering with Link button("lnkLoadControl") . On click on "lnkLoadControl" I am able to load Usercontrol("LeftVerticalLayOut.ascx") onto the updatepanel. Now the jquery datatable I am creating in load event of Usercontrol is getting generated.


After the datatable(having id as "example") is created, I am calling the below code in my

function loadHandler()

function BeginRequestHandler(sender, args)

function EndRequestHandler(sender, args)

Invalid length parameter passed to the SUBSTRING function


Hi all,

I am having a weird issue after we upgraded our DB server to SQL 2005.

I have a SP used to extract exchange rate, and a job calls this SP daily. This job worked fine on SQL 2000, and works very well in Management studio if I call this SP seperately, but failed in sql job in 2005.

The error statement pointed to:

select left(@row, charindex(',', @row)-1),  REVERSE(left(@reversedrow, charindex(',', @reversedrow)-1))

The error message is:

Invalid length parameter passed to the SUBSTRING function.

Anyone knows what's the difference for LEFT function between sql 2000 and 2005?


how to use jQuery to get MVC controller action?



I have this action on below

public ActionResult Edit(int id)

            var mtn0120 = __context.GetMtn0120(id);
            TempData["EditDateTime"] = mtn0120.EditDatetime;
            return View(mtn0120);

So how do I:

-use jquery $.get to access this action then redirect to the view?

-can I do it without using json?

-can I do it without modify the codes above?


Any better than jquery dynamically write html code?


I am creating a page which contains one grid showing the content from a very slow data source. There are other faster contents to be displayed too.

I know I can use jquery to dynamically generate the html code from a dedicated controller for the slow data source. 

However, it's not intuitive to read the jquery code for the grid. is there any better way?

Dynamically Loaded Images into jQuery Slider


Hi there,

I didnt want to re-invent the wheel...

Is there a jQuery Tutorial that you can point me to for populating a jQuery Slider with image urls from my database dynamically - or does anyone have code they could send me?

Tried goggling but keep running into dead ends.

Want to create something like what is on the bottom of here - http://02112010trendyshoes180.noptemplate.com/default.aspx

How to index a page that uses jquery to dynamically load

I have an html page that dynamically loads content using jquery.  After the page initially renders, it takes 1-2 seconds for the data to be populated from the javascript.  As a result, the Sharepoint indexer is not able to "see" any of this dynamic content and it is not searchable.  Are there any workarounds for this? 

JQuery getJSON call to MVC Controller not returning data


This is probably something simple. The following JQuery call is executing can calling the controller and the controller is executing correctly. I used the sample data that's commented out to verify that the templates were working also.

However, the success function is not executing in the browser. Any thoughts or other ways I can debug this?

<script type="text/javascript">
@* var myData = [ {first: "Jane", last: "Doe"}, {first: "John", last: "Doe"} ]; *@

Retrieving JQuery Ajax Parameter in ASHX (Handlers) files


Hi everyone;

I have an Jquery Ajax which sends JSON data to an *.ashx file (In data section of JQuery Ajax command). 

Now, I'm asking how can I retrieve this string (data) in my ashx file



how to pass a xml data record dynamically into a parameter


Hi all,

I just want to know how to send a xml record in a table into a parameter dynamically ! Is this possible? If yes please reply me


 i need to set @parameter1 = select * from dbo.DB_CUSTOMERS for XML PATH , ROOT ('Customers')

GridView Confirmation Box Using JQuery BlockUI in asp.net

JQuery is the most popular JavaScript library. One of the main reasons for its fame is the plugin architecture. Anyone can create a separate library that leverage the JQuery library. In this article we are going to look at the BlockUI library which is used to block the user screen while performing a task.

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

call JavaScript - jQuery code from ASP.NET Server-Side

jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend