i have this error on this line of code
protected void btnSearch_Click(object sender, EventArgs e)
{
string Name = Request.Form[txtSearch.UniqueID];
string username = Request.Form[hfUserName.UniqueID];
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Name: " + Name + "\\nID: " + username + "');", true);
}
}
error
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'ClientScript' does not exist in the current context
Source Error:
Line 21: string Name = Request.Form[txtSearch.UniqueID];
Line 22: string username = Request.Form[hfUserName.UniqueID];
Line 23: ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Name: " + Name + "\\nID: " + username + "');", true);
Line 24: }
Line 25: }
Also this page methode is from which section , i dont understand this
url: '<%=ResolveUrl("~/Timeline.aspx/GetNames") %>',
what is the getNames?,
<script type="text/javascript">
$(function () {
$("[id$=txtSearch]").autocomplete({
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/Timeline.aspx/GetNames") %>',
data: "{ 'prefix': '" + request.term + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('-')[0],
val: item.split('-')[1]
}
}))
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
select: function (e, i) {
$("[id$=hfUserName]").val(i.item.val);
},
minLength: 1
});
});