yad4u How to call popup window in asp.net mvc?


How to call popup window in asp.net mvc?



hello i have js file for the popup window. i have used in asp.net but its not working in asp.net mvc can anyone tell me how to use this code in mvc

<script type="text/JavaScript"> function openUserSavedListDetailsPopUp(id) {     dhtmlmodal.open('UserInfo', 'iframe',            'UserSavedListDetails.aspx?listId=' + id,            '', 'width=710px,height=150px,center=1,resize=0,scrolling=0') } </script> 

on page:

 <a  href="#" onclick='openUserSavedListDetailsPopUp(<%# DataBinder.Eval(Container.DataItem, "OrderId")%>)' > hello </a> 

thank you in advance




Is there a template language for ASP.NET MVC like JSTL and OGNL?

1:



Selling upper management on converting to ASP.NET from Classic ASP
The statement that is (probably) not working in your MVC app is the call to <%# DataBinder.Eval(...) %>.


Membership provider stopped working on using Membership Provider in ASP.Net MVC
In MVC, I assume you have a for loop or something that iterates over your model? Maybe something like this?*.
Design decisions
<% foreach(var item in Model) { %>     <a href="#" onclick='openUserSavedListDetailsPopUp(<%: item.OrderId %>)>hello</a> <% } %> 
I'd also recommend using some type of javascript library, for example jQuery, to hook up the onclick events instead of having the javascript inline.


ASP.NET Exception Handling in background threads
For this particular case jQuery might not add much value to your application (except that your code will probably be cleaner), but it really helps for anything from ajax calls to DOM manipulation and animation..
MVC2 or WCF for an XML/JSON REST API?
And finally, you should have a fallback for browsers that don't support (or have disabled) javascript.


How do you update the aspnetdb membership IsApproved value?
The easy way is to change your link to this:.
Restrict file types allowed for upload asp.net
<a href="urltothepopupcontentpage.html?id=<%: item.OrderId %>" onclick='openUserSavedListDetailsPopup(<%: item.OrderId %>); return false'>hello</a> 
The call to return false will ensure that if your script can run, it stops the default action (following the link).. *) Note: using <%: ...

%>
instead of <%= Html.Encode(...) %> requires that you use ASP.NET 4.

If you are running .NET 3.5, you use the = sign as usual..



88 out of 100 based on 58 user ratings 808 reviews