Click here to Skip to main content
16,010,650 members
Home / Discussions / Mobile
   

Mobile

 
Question'SetKMode()' active in Windows Mobile 6.0 Pin
tony_Udz29-Apr-08 21:04
tony_Udz29-Apr-08 21:04 
AnswerRe: 'SetKMode()' active in Windows Mobile 6.0 Pin
Arjun Marwaha1-May-08 12:13
Arjun Marwaha1-May-08 12:13 
GeneralRe: 'SetKMode()' active in Windows Mobile 6.0 Pin
tony_Udz4-May-08 19:31
tony_Udz4-May-08 19:31 
AnswerRe: 'SetKMode()' active in Windows Mobile 6.0 Pin
Arjun Marwaha7-May-08 5:05
Arjun Marwaha7-May-08 5:05 
GeneralRe: 'SetKMode()' active in Windows Mobile 6.0 Pin
tony_Udz7-May-08 19:14
tony_Udz7-May-08 19:14 
GeneralRe: 'SetKMode()' active in Windows Mobile 6.0 Pin
Arjun Marwaha8-May-08 11:16
Arjun Marwaha8-May-08 11:16 
QuestionForm Size Pin
Rupesh Kumar Swami29-Apr-08 20:47
Rupesh Kumar Swami29-Apr-08 20:47 
Questionfile upload in mobile webform Pin
ronak.thakkar29-Apr-08 20:45
ronak.thakkar29-Apr-08 20:45 
Hi Guys,
I am developing a website using asp.net for mobile. I have requirement to upload images from mobile to webserver. I have write the code which works perfectly in openwave simulator. But when I am trying it in windows smartphone 2003 SE emulator then it does not display the file upload control. I can see only the Upload button.

I have also tried but it does not work. Please tell me the solution for this problem. Thanks in advance.

This is the aspx file
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MobTest1.aspx.cs" Inherits="MobTest1" %>

<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<body >
<mobile:Form ID="Form1" Runat="server" >
<mobile:DeviceSpecific ID="device1" Runat="server">
<Choice Xmlns="http://schemas.microsoft.com/intellisense/ie3-2nav3-0" >
<HeaderTemplate>
<asp:FileUpload ID="ftxt" runat="server" ToolTip="Jay" />
</HeaderTemplate>
</Choice>
</mobile:DeviceSpecific>
<mobile:Command ID="cmd" Runat="Server" OnClick="cmd_Click">Upload</mobile:Command>
<mobile:Label id="lbl" runat="server"></mobile:Label>
</mobile:Form>&nbsp;

</body>
</html>

Code behind file:

protected void cmd_Click(object sender, EventArgs e)
{

try
{
System.Web.UI.WebControls.FileUpload ftxt;

ftxt = (System.Web.UI.WebControls.FileUpload)Form1.Header.FindControl("ftxt");

if (ftxt.UniqueID == "ctl00$ftxt")
{

string[] str = Request.Form.GetValues(2);
string file = System.IO.Path.GetFileName(str[0].Substring(1));
string path = Server.MapPath("Image//") + DateTime.Now.Millisecond + file;
FileStream fs = File.Create(path);
byte[] bt = File.ReadAllBytes(str[0]);
fs.Read(bt, 0, Convert.ToInt32(bt.Length));
fs.Close();
DirectoryInfo Folder = new DirectoryInfo(path);
string FilePathSave = Folder.ToString();
File.WriteAllBytes(FilePathSave, bt);
lbl.Text = "Uploaded Successfully";
}

else
{

string[] str = Request.Form.GetValues(1);
string file = System.IO.Path.GetFileName(str[0].Substring(5));
string path = Server.MapPath("Image//") + file;
FileStream fs = File.Create(path);
byte[] bt = File.ReadAllBytes(str[0].Remove(0, 5));
fs.Read(bt, 0, Convert.ToInt32(bt.Length));
fs.Close();
DirectoryInfo Folder = new DirectoryInfo(path);
string FilePathSave = Folder.ToString();
File.WriteAllBytes(FilePathSave, bt);

}



}
catch(Exception ex)
{
}
}
AnswerRe: file upload in mobile webform Pin
Arjun Marwaha2-May-08 9:04
Arjun Marwaha2-May-08 9:04 
QuestionTransparent control Pin
tanton-gaston29-Apr-08 6:23
tanton-gaston29-Apr-08 6:23 
AnswerRe: Transparent control Pin
Arjun Marwaha1-May-08 10:58
Arjun Marwaha1-May-08 10:58 
GeneralRe: Transparent control Pin
Rupesh Kumar Swami1-May-08 22:46
Rupesh Kumar Swami1-May-08 22:46 
GeneralRe: Transparent control Pin
Arjun Marwaha2-May-08 6:11
Arjun Marwaha2-May-08 6:11 
QuestionAdd contact to Pocket PC Pin
Rupesh Kumar Swami29-Apr-08 3:25
Rupesh Kumar Swami29-Apr-08 3:25 
AnswerRe: Add contact to Pocket PC Pin
Arjun Marwaha29-Apr-08 10:29
Arjun Marwaha29-Apr-08 10:29 
GeneralRe: Add contact to Pocket PC Pin
Rupesh Kumar Swami29-Apr-08 20:40
Rupesh Kumar Swami29-Apr-08 20:40 
Generalsymbain os Pin
ravilikesaboli29-Apr-08 1:08
ravilikesaboli29-Apr-08 1:08 
GeneralRe: symbain os Pin
Cedric Moonen29-Apr-08 2:30
Cedric Moonen29-Apr-08 2:30 
Generalsymbian os Pin
ravilikesaboli29-Apr-08 1:07
ravilikesaboli29-Apr-08 1:07 
GeneralRe: symbian os Pin
Vasudevan Deepak Kumar2-May-08 0:45
Vasudevan Deepak Kumar2-May-08 0:45 
QuestionIs it not possible to create a window which is originally minimized in Windows CE 5.0? Pin
Klive829-Apr-08 0:15
Klive829-Apr-08 0:15 
QuestionTreeView Control Problem ? Pin
monafr8128-Apr-08 5:28
monafr8128-Apr-08 5:28 
GeneralRe: TreeView Control Problem ? Pin
Arjun Marwaha29-Apr-08 9:16
Arjun Marwaha29-Apr-08 9:16 
GeneralRe: TreeView Control Problem ? Pin
monafr811-May-08 2:41
monafr811-May-08 2:41 
GeneralRe: TreeView Control Problem ? Pin
Arjun Marwaha1-May-08 10:25
Arjun Marwaha1-May-08 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.