我正在从ASCX文件空值 [英] I am getting null value from ascx file
问题描述
我正在距离Plaka。如何空值我可以解决这个problem.pages的ASCX文件中动态创建的。
I am getting null value from Plaka .How can I solve this problem.pages created dynamically inside the ascx file .
JavaScript的一部分:
javascript part:
var myFunction = function()
{
Vp= #{txtPlaka}.getValue();
$("#<%=FileUpload1.ClientID%>").uploadify('upload','*');
};
$(document).ready(function () {
var Vp ="";
$('#btnMusteriEkle').click(myFunction);
$("#<%=FileUpload1.ClientID%>").uploadify({
'uploader': 'Upload.ashx',
'swf': 'uploadify/uploadify.swf',
'script': 'Upload.ashx',
'cancelImg': 'images/cancel.png',
'folder': 'upload',
'multi': true,
'method': 'post',
'buttonText': 'RESIM SEC',
'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg',
'auto': false,
'formData': { 'id': 'id', 'Plaka': Vp, 'Foo':'foooo'},
onAllComplete: function (event, data) {
}
});
});
</script>
upload.ashx文件
upload.ashx file
///我在这里得到空值(pwd5).pwd1和pwd2为好,
///我能赶上他们的值
/// I am getting null value here(pwd5).pwd1 and pwd2 is okey, ///I can catch them values
string pwd5 = context.Request.Form["Plaka"];
string pwd1 = context.Request.Form["Id"];
string pwd2 = context.Request.Form["Foo"];
和这里的标记语法
<ext:TextField ID="txtPlaka" runat="server" FieldLabel="Plaka" Flex="1" AllowBlank="false" ClientIDMode="Static">
</ext:TextField>
<ext:Button runat="server" ClientIDMode="Static" ID="btnMusteriEkle" Text="Yeni müşteri ekle">
<Listeners>
<Click Handler="
$('#FileUpload1').uploadify('upload','*'))">
</Click>
</Listeners>
</ext:Button>
下面是我的逻辑我也跟着:先准备功能创建的变种VP内=;后绑定函数调用myFunction的,后来,运行uplodify功能。当用户点击该按钮,此绑定已经定义($ (#btnMusteriEkle')点击(myFunction的);),直接运行myFunction的和asigned VP值#{} txtPlaka .getValue();并运行uplodify()函数,这些值(VP),应该通过uploadify功能但到目前为止,没了不起作用。
Here is the my logic I followed: first inside the ready function created var Vp="";later bind the function called myFunction, later, run the uplodify function.when the user clicked the button, this binding already defined ($('#btnMusteriEkle').click(myFunction);), directly run the myFunction and asigned Vp value as #{txtPlaka}.getValue();and run uplodify() function, those value(Vp), should pass the uploadify function but so far, nope doesn't work.
推荐答案
要带胡乱猜测这里,我不知道很多关于ASCX文件。
Gonna take a wild guess here, i don't know much about ascx files.
问:这是您使用上传的部分。
Question: Is this the part you use to upload?
$("#<%=FileUpload1.ClientID%>").uploadify({
'uploader': 'Upload.ashx',
'swf': 'uploadify/uploadify.swf',
'script': 'Upload.ashx',
'cancelImg': 'images/cancel.png',
'folder': 'upload',
'multi': true,
'method': 'post',
'buttonText': 'RESIM SEC',
'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg',
'auto': false,
'formData': { 'id': 'id', 'Plaka': Vp, 'Foo':'foooo'},
onAllComplete: function (event, data) {
同时尝试这个办法:
Meanwhile try this:
var upload;
var myFunction = function()
{
Vp= {txtPlaka}.getValue();
upload()
};
$(document).ready(function () {
var Vp ="";
$('#btnMusteriEkle').click(myFunction);
upload = function(){
$("#<%=FileUpload1.ClientID%>").uploadify({
'uploader': 'Upload.ashx',
'swf': 'uploadify/uploadify.swf',
'script': 'Upload.ashx',
'cancelImg': 'images/cancel.png',
'folder': 'upload',
'multi': true,
'method': 'post',
'buttonText': 'RESIM SEC',
'fileExt': '*.jpg;*.png;*.gif;*.bmp;*.jpeg',
'auto': false,
'formData': { 'id': 'id', 'Plaka': Vp, 'Foo':'foooo'},
onAllComplete: function (event, data) {
}
});
}
});
这篇关于我正在从ASCX文件空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!