Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 788961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:27:01+00:00 2026-05-14T21:27:01+00:00

hello i have js file for the popup window. i have used in asp.net

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:27:02+00:00Added an answer on May 14, 2026 at 9:27 pm

    The statement that is (probably) not working in your MVC app is the call to <%# DataBinder.Eval(...) %>. In MVC, I assume you have a for loop or something that iterates over your model? Maybe something like this?*

    <% 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. 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.

    And finally, you should have a fallback for browsers that don’t support (or have disabled) javascript. The easy way is to change your link to this:

    <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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I have used OpenFileDialog in WPF for opening file, when I used first
Hello i have a php file that is dynamically creating images. Basically its adding
Hello I have the code below that for some reason is not working: I
Hello I have a problem wherein I have to read a huge csv file.
I have a file template.txt which contains the following: Hello ${something} I would like
I have a template file( template.txt ): Hello, $x Hello, $y I have a
I have a text file which contains something like this: Hello, my name is
I have a ruby file as follows: module Example class Myclass def t_st Hello
First, I have an xml file in res/xml <?xml version=1.0 encoding=utf-8?> <rootelement1> <subelement> Hello
So I have a main.py file inside /home/richard/projects/hello-python directory: import sys sys.path.append('/home/richard/projects/hello-python') from Encode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.