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 9119123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:19:10+00:00 2026-06-17T05:19:10+00:00

Is it possibel to load an _PartialView in ASP.Net MVC 4. I no that

  • 0

Is it possibel to load an _PartialView in ASP.Net MVC 4. I no that it’s possibel to load it with the content

var defaultInfobox = new Microsoft.Maps.Infobox(map.getCenter(), infoboxOptions );    
 map.entities.push(defaultInfobox);
 defaultInfobox.setHtmlContent('<div id="infoboxText" style="background-color:White; border-style:solid;border-width:medium; border-color:DarkOrange; min-height:100px;width:240px;"><b id="infoboxTitle" style="position:absolute; top:10px; left:10px; width:220px;">myTitle</b><a id="infoboxDescription" style="position:absolute; top:30px; left:10px; width:220px;">Description</a></div>'); 

But i have not found any examples using an cshtml view.

Update:

 var pushpinOptions = { icon: '../images/BingMap/discussion-icon-ny.png', width: 30, height: 40 };
                    var latLon = new Microsoft.Maps.Location(location.latitude, location.longitude);
                    var pin = new Microsoft.Maps.Pushpin(latLon, pushpinOptions);
                    pin.Title = name;//usually title of the infobox
                    pin.Description = set; //information you want to display in the infobox
                    pinLayer.push(pin);//add pushpin to pinLayer
                    Microsoft.Maps.Events.addHandler(pin, 'click', displayInfobox);
  • 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-06-17T05:19:11+00:00Added an answer on June 17, 2026 at 5:19 am
    1. Step: Put your html in a partial view
    2. Step: Install and Integrate JavaScriptModel ( http://jsm.codeplex.com )
    3. Step: You need the following method in your Controller Base:

      public string RenderPartialViewAsString(string partialViewName, object model = null)
      {
          if (partialViewName == null)
              throw new ArgumentNullException("partialViewName");
      
          ViewDataDictionary viewData = new ViewDataDictionary(model);
      
          using (StringWriter writer = new StringWriter())
          {
              ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, partialViewName);
      
              if (viewResult == null || viewResult.View == null)
                  throw new InvalidOperationException(string.Format("Could not find partial view with name '{0}'", partialViewName));
      
              ViewContext viewContext = new ViewContext(ControllerContext, viewResult.View, viewData, TempData, writer);
              viewResult.View.Render(viewContext, writer);
      
              return Regex.Replace(writer.ToString(), @"[\t\n\r]", string.Empty, RegexOptions.Compiled);
          }
      }
      
    4. Step: Now you can add partial views to javascript variables anytime you want. E.g. you could write in your controller action:

      this.AddJavaScriptVariables("MyJavaScriptVariable", RenderPartialViewAsString("MyBingPartialView"));
      
    5. Step: Edit your js.file:

      defaultInfobox.setHtmlContent(MyJavaScriptVariable);
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am playing around with AJAX functionality using ASP.NET MVC. I have created a
Is it possible to load external web-parts in an ASP.NET website? I would like
Is it possible to load content within an IFRAME that subsequently returns a 302
Working with ASP.NET MVC, KnockoutJS and I am using Require JS. I have a
Is it possible to load new lines from a text file to variables in
Is it possible to load a User Control that was registered in the web.config
Is it possible to load just tabs when page is loaded? Sample code: http://jsfiddle.net/MWtMR/2/
Is it possible to load the content of a Spry tab when the tab
Is it possible to load new data between td tags and change the background
is that possible to load another page with jquery ui dialog ? Like Dialog

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.