Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

mvc c# return renderPartial

// Create a container for your data
<div id="ViewHolder"><div>

//You can call your method using ajax:
$.ajax({
	type: "POST",
	url: '<Your path to your controller>/GetView',
	contentType: "application/text; charset=utf-8",
	dataType: "text",
	async: false,
	success: function (data) {
		// Populate your container
		$('ViewHolder').html(data);
	}
})

// In your controller 
public PartialViewResult GetView()
{
	//Passing a model is optional
  	MyModel myModel = new MyMyodel();
	return PartialView("<Your View Name>", myModel);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: hide numericUpDown arrows 
Csharp :: c# bootstrap checkbox 
Csharp :: edit list element linq c# 
Csharp :: get key in dictionary c# 
Csharp :: c# generic return type in interface 
Csharp :: How to use the protected keyword in C# 
Csharp :: c# generate random int list 
Csharp :: find all factors of a given number 
Csharp :: how to cut a string in c# 
Csharp :: open linkedlabel c# 
Csharp :: substring in c# 
Csharp :: photon2 addcalbacktarget 
Csharp :: itext7 pdfwriter outputstream c# 
Csharp :: upload a file selenium c# 
Csharp :: give an alias in model .net 
Csharp :: winform fixed size 
Csharp :: unity reload active scene 
Csharp :: how to pause a console.writeline in C# 
Csharp :: unity gun clipping through walls 
Csharp :: set request size c# 
Csharp :: structure in c sharp with example 
Csharp :: drawing default serializedproperty unity 
Csharp :: c# get executing file name 
Csharp :: c# array to label 
Csharp :: net user add ne user windows 10 
Csharp :: mysql restore backup from multiple files 
Csharp :: c# move directory 
Csharp :: c# datagridview change column alignment 
Csharp :: int if null put zero c# 
Csharp :: how to make a cast in c# 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =