"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
Html.AutoCompleteTextBox("SurgeonName", "SurgeonID", Url.Action("GetSurgeonsByName"), "onGetSurgeonsResult", new { maxlength = 50 }, new
{
dataType = "\"json\"",
parse = "OnParseGetSurgeons",
formatItem = "OnGetSurgeonsFormatItem",
})
)
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
tanay_s
0 Points
28 Posts
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 01, 2010 06:43 AM|LINK
Hi, I would please like to know how the following AutoComplete can be implemented:
<td>@Html.AutoCompleteTextBox("SurgeonName", "SurgeonID", Url.Action("GetSurgeonsByName"), "onGetSurgeonsResult", new { maxlength = 50 }, new
{
dataType = "\"json\"",
parse = "OnParseGetSurgeons",
formatItem = "OnGetSurgeonsFormatItem",
})</td>
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 05, 2010 04:51 PM|LINK
Where is AutoCompleteTextBox is defined
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
tanay_s
0 Points
28 Posts
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 06, 2010 09:03 AM|LINK
Hi, this is defined in a helper AutoCompleteTextboxExtension.cs
public static string AutoCompleteTextBox(this HtmlHelper html,string textBoxName,string hiddenFieldName,string url,string resultCallback,object htmlAttributes,object options)
{
return
(string.Format("{0} \r\n {1}\r\r",
html.TextBox(textBoxName, null, htmlAttributes),
string.IsNullOrEmpty(hiddenFieldName) != true ? html.Hidden(hiddenFieldName) : MvcHtmlString.Empty
)) +
InitializeAutoComplete(html, textBoxName, url, resultCallback, options, true);
}
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 06, 2010 09:42 AM|LINK
This looks like OK, What is the problem?
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
tanay_s
0 Points
28 Posts
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 07, 2010 06:51 AM|LINK
I'm getting the following output:
<input id="SurgeonName" maxlength="50" name="SurgeonName" type="text" value="" /> <input id="SurgeonID" name="SurgeonID" type="hidden" value="" /> <script language='javascript'> $(function () { $.ajaxSetup({ type: "POST" }); $('#SurgeonName').autocomplete('/DisplayBoard/GetSurgeonsByName', { dataType : "json", parse : OnParseGetSurgeons, formatItem : OnGetSurgeonsFormatItem }); $('#SurgeonName').result(function(e, d, f) { onGetSurgeonsResult(e, d, f); }); $('#SurgeonName').blur(function(){ $('#SurgeonName').search(); }); }); </script>
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 08, 2010 04:42 AM|LINK
What are you asking? Is this not work for you?
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD
tanay_s
0 Points
28 Posts
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 08, 2010 07:23 AM|LINK
Hi, the above output I am getting on the page where I expect the textbox to be present. I am not seeing the textbox at all.
The above output should actually be seen on the View Source page.
But on the View Source page I see the following:
<td><input id="SurgeonName" maxlength="50" name="SurgeonName" type="text" value="" />
<input id="SurgeonID" name="SurgeonID" type="hidden" value="" />
<script language='javascript'>
$(function () {
$.ajaxSetup({ type: "POST" });
$('#SurgeonName').autocomplete('/DisplayBoard/GetSurgeonsByName', {
dataType : "json",
parse : OnParseGetSurgeons,
formatItem : OnGetSurgeonsFormatItem
});
$('#SurgeonName').result(function(e, d, f) {
onGetSurgeonsResult(e, d, f);
});
$('#SurgeonName').blur(function(){
$('#SurgeonName').search();
});
});
</script>
</td>
Thus it is not recognising the quotes and grt.than/less than signs.
imran_ku07
All-Star
45815 Points
7698 Posts
MVP
Re: Migrate an ASP.NET MVC 2 project to MVC 3 Razor view
Oct 08, 2010 07:29 AM|LINK
@MvcHtmlString.Create(
Html.AutoCompleteTextBox("SurgeonName", "SurgeonID", Url.Action("GetSurgeonsByName"), "onGetSurgeonsResult", new { maxlength = 50 }, new
{
dataType = "\"json\"",
parse = "OnParseGetSurgeons",
formatItem = "OnGetSurgeonsFormatItem",
})
)
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD