T
T.Jeywin Lizy
I am unable to upload a file in PDA(IE Mobile Ver. 5) with FileUpload control.
Please help me with the work around to acheive this task.
I read in this community as given below. If this can be used please let me
know how I should use this class given below with FileUpload control to serve
my purpose.
Info from your Community is as given below:
--------------------------------------------------
The reason upload control can't work on mobile page is the result rendered
by mobile page is lacking a form property: enctype="multipart/form-data".
To inject this property you can inherit Html/Chtml/XhtmlMobileTextWriter
class and override their WriteBeginTag method. The override method is
something link below:
public class ChtmlMobileMultipartTextWriter :
System.Web.UI.MobileControls.Adapters.ChtmlMobileTextWriter
{
public ChtmlMobileMultipartTextWriter(System.IO.TextWriter writer,
MobileCapabilities device)
: base(writer, device)
{
}
public override void WriteBeginTag(string tag)
{
if (tag == null)
{
throw new ArgumentNullException("tag");
}
base.WriteBeginTag(tag);
if (tag.Equals("form"))
{
WriteAttribute("enctype", "multipart/form-data");
}
}
}
Please help me with the work around to acheive this task.
I read in this community as given below. If this can be used please let me
know how I should use this class given below with FileUpload control to serve
my purpose.
Info from your Community is as given below:
--------------------------------------------------
The reason upload control can't work on mobile page is the result rendered
by mobile page is lacking a form property: enctype="multipart/form-data".
To inject this property you can inherit Html/Chtml/XhtmlMobileTextWriter
class and override their WriteBeginTag method. The override method is
something link below:
public class ChtmlMobileMultipartTextWriter :
System.Web.UI.MobileControls.Adapters.ChtmlMobileTextWriter
{
public ChtmlMobileMultipartTextWriter(System.IO.TextWriter writer,
MobileCapabilities device)
: base(writer, device)
{
}
public override void WriteBeginTag(string tag)
{
if (tag == null)
{
throw new ArgumentNullException("tag");
}
base.WriteBeginTag(tag);
if (tag.Equals("form"))
{
WriteAttribute("enctype", "multipart/form-data");
}
}
}