Click here to Skip to main content
16,021,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

How to render a ul list(coming from DB) in to a blank Partial view page using jquery.
Here I don't want to load page like below

$("#div1").html(result);

I want to load the content in jquery using the partial view name

Please help

Thanks & Regards,
Soumya
Posted

1 solution

Why don't you want to use the method that works ? You can browse to a partial view, if you want to, because the server will still find it. However, you want to make the request, get the HTML and then stuff it in to a div, using EXACTLY the jquery you posted. I am not sure what other method you are imagining you could use, but I'd create a method I could call with AJAX, so that I got returned the string in question and could stuff it where I wanted. AJAX is the only way I can think of to ask javascript to make a web request and store the result in a string.
 
Share this answer
 
Comments
soumyaraj 21-Jun-13 4:37am    
Thank you Christian..

Here I want to load dynamic UL list from the Db to the partial view but JavaScript is not affecting for the partial view.When I put hardcoded the ul list it's working fine

The javasript put it on the masterpage and used Html.RenderPartial method for calling partialview

The funny thing is when I added just one alert box in to the javascript it's working fine in firefox(but not working in chrome)

I don't know the reason

Please help me

Thanks & regards,
Soumya

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900