-
8 Nov 2011 6:53 AM #21Ext JS Premium Member
- Join Date
- Apr 2008
- Location
- Groningen - Netherlands
- Posts
- 1,017
- Vote Rating
- 23
- Answers
- 75
1) Maybe not post a bug yet, wait until other users come up with this problem. Probably writer: 'json' works if you send data from the model. Bugs you can post on the Bug thread.
2) You're right it is not anymore in the documentation, but people left some comments about it in the API.
3) People mark their own answers all the time. Mark the post you think is the best answer to the problem you posted. If this is marked people will know it is solved, so mark something.
-
8 Nov 2011 7:15 AM #22
In the spirit of testing stuff out I gave this a try and was not successful.
I will search the bugs forum to see if I can find something relating to this. It's difficult because I am not quite sure if I am using the object incorrectly, if there are some undocumented properties I am not utilizing or if there actually is a bug .
-
6 Jul 2012 8:07 PM #23
Here my code i don't what's wrong in that.
buttons: [{text:'Login',handler : function() {
Ext.Ajax.request
({
url: 'Default.aspx?type=Login',
method: 'POST',
params:
{
action: 'new',
//modify date
Name:'thilak'
},
waitMsg: 'Saving Data...',
success: function(response)
{
var s = response.responseText;
var respon = response.responseText;
if(respon==1)
{
Ext.MessageBox.hide();
Ext.MessageBox.alert('Status','Logged In Successfully');
window.location = 'Login.php';
}
else
{
Ext.MessageBox.hide();
Ext.MessageBox.alert('Status','Log In Failed!');
}
}
});
}
}, {text:'Reset'}]});
C# Code :
string action = Request.QueryString["type"];if (action != string.Empty)
switch (action)
{case"Login":
Response.ContentType = "text/html";
Response.Write(1);
break;
}
But in the i get a Response like :
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
Untitled Page
</title><link href="ExtJS/resources/css/ext-all.css" rel="stylesheet" type="text/css" /></head>
<body>
<form name="form1" method="post" action="Default.aspx?type=Login" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0MDkxNzYwNDNkZMqODl+2ksqIiQHUa9wayQUUyTs9" />
</div>
<div>
<script type="text/javascript" language="javascript" src="ExtJS/adapter/ext/ext-base.js"></script>
<script type="text/javascript" language="javascript" src="ExtJS/ext-all.js"></script>
<script type="text/javascript" language="javascript" src="Scripts/default.js"></script>
</div>
</form>
</body>
</html>
Help :
I need to get only one(1) as result
-
9 Jul 2012 3:40 AM #24Ext JS Premium Member
- Join Date
- Apr 2008
- Location
- Groningen - Netherlands
- Posts
- 1,017
- Vote Rating
- 23
- Answers
- 75
I created json handlers for that. Default.aspx returns viewstate and other stuff. In that case you must create a new aspx file and strip all its output.
Or you can do something like this
Create a AjaxHandler.cs
And register it in the webconfig in the httpHandler sectionCode:public class AjaxHandler : IHttpHandler, System.Web.SessionState.IRequiresSessionState { public AjaxHandler() { } HttpRequest request; HttpResponse response; HttpContext context; public void ProcessRequest(HttpContext context) { this.request = context.Request; this.response = context.Response; this.context = context; //In .xml is requested. A file with that extension //Does not need to exist. //Content type of the output stream. Extjs dataStores Xmlreaders require the contenttype text/xml //Response.ContentType = "application/x-json"; response.ContentType = "text/javascript"; //write response here } public bool IsReusable { // To enable pooling, return true here. // This keeps the handler in memory. get { return false; } } }
In that way the handler will catch all the jx extentions. In the Ajaxt.Request you set the url like yourservice.jxCode:<add path="*.jx" verb="*" type="AjaxHandler"/>
You could use an other extention as well


Reply With Quote