Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
AnswerRe: ShowDialog Pin
AB777124-Jan-06 21:06
AB777124-Jan-06 21:06 
AnswerRe: ShowDialog Pin
AB777124-Jan-06 21:23
AB777124-Jan-06 21:23 
GeneralRe: ShowDialog Pin
microsoc24-Jan-06 23:48
microsoc24-Jan-06 23:48 
Questionxls File Parser Pin
xoxoxoxoxoxox23-Jan-06 21:15
xoxoxoxoxoxox23-Jan-06 21:15 
AnswerRe: xls File Parser Pin
albCode24-Jan-06 2:11
albCode24-Jan-06 2:11 
Questionupdate MS Access using filesystemwatcher event handler Pin
hongweng23-Jan-06 21:12
hongweng23-Jan-06 21:12 
AnswerRe: update MS Access using filesystemwatcher event handler Pin
Garry Stewart23-Jan-06 21:37
Garry Stewart23-Jan-06 21:37 
Questionredirecting page in asp.net Pin
inaureen23-Jan-06 20:24
inaureen23-Jan-06 20:24 
I am working on a web chat application that is using Sockets. when a client application recieves message from server application its method is call back named OnDataRecieved(IAsyncResult asyn). but when data is recieved on the client side it does not show tha value of data recieved in textbox, the reason behind is that page is not being refreshed. OnDataRecieved() method is as follows:


public void OnDataReceived(IAsyncResult asyn)
{
try
{
SocketPacket theSockId = (SocketPacket)asyn.AsyncState ;
int iRx = theSockId.thisSocket.EndReceive (asyn);
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
int charLen = d.GetChars(theSockId.dataBuffer, 0, iRx, chars, 0);
System.String szData = new System.String(chars);
bool chk = false;
//

if (szData=="|\0")
{
chk_list=false;
Object objData = '~' + txtname.Text + '\n';
byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString ());
if(m_clientSocket != null)
{
m_clientSocket.Send (byData);
}
}
else
{
if (chk_list==false)
{
listBox1.Items.Clear();
chk_list=true;
}
if (szData== "~\0")
{
chk = true;
chk_msgtype=true;
}
//
if (chk == false)
{
str+=szData[0];
}

if (szData=="\n\0")
{
if(chk_msgtype == true)
{

listBox1.Items.Add(str.ToString());
chk_msgtype=false;
}
else
{
if (richTextRxMessage.Text!="")
{
/*richTextRxMessage.Text += str;
a.Text=str;
Label1.Text = "1234";*/
Session.Add("message",str);
Response.Redirect("SocketClient.aspx");

//Response.Write(str);
}
else
richTextRxMessage.Text=str;
//richTextRxMessage.Text+="\n";
}

str="";
}

}

WaitForData();
}


when this method calls Response.Redirect("SocketClient.aspx"); it provides followingg error.

An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll

Additional information: Response is not available in this context.


I want my page to be postback after this method is called but response.redirect is not working. can anybody tell me y isnt it working and how can i perform the same task

AnswerRe: redirecting page in asp.net Pin
Garry Stewart23-Jan-06 20:53
Garry Stewart23-Jan-06 20:53 
GeneralRe: redirecting page in asp.net Pin
Guffa23-Jan-06 21:48
Guffa23-Jan-06 21:48 
GeneralRe: redirecting page in asp.net Pin
inaureen23-Jan-06 22:01
inaureen23-Jan-06 22:01 
QuestionTo Constantly ping the system. Pin
Venkat_8323-Jan-06 18:36
Venkat_8323-Jan-06 18:36 
AnswerRe: To Constantly ping the system. Pin
AB777124-Jan-06 0:34
AB777124-Jan-06 0:34 
AnswerRe: To Constantly ping the system. Pin
mitooki24-Jan-06 1:30
mitooki24-Jan-06 1:30 
QuestionConvert a 2003 project to a 2005 project Pin
NewbieDude23-Jan-06 18:16
NewbieDude23-Jan-06 18:16 
AnswerRe: Convert a 2003 project to a 2005 project Pin
M@dHatter23-Jan-06 18:33
M@dHatter23-Jan-06 18:33 
GeneralRe: Convert a 2003 project to a 2005 project Pin
NewbieDude23-Jan-06 18:39
NewbieDude23-Jan-06 18:39 
QuestionCan't make array class data shown in a label Pin
Albert8323-Jan-06 17:57
Albert8323-Jan-06 17:57 
AnswerRe: Can't make array class data shown in a label Pin
AB777123-Jan-06 19:36
AB777123-Jan-06 19:36 
GeneralRe: Can't make array class data shown in a label Pin
Albert8324-Jan-06 9:40
Albert8324-Jan-06 9:40 
GeneralRe: Can't make array class data shown in a label Pin
AB777124-Jan-06 16:58
AB777124-Jan-06 16:58 
GeneralRe: Can't make array class data shown in a label Pin
Albert8324-Jan-06 20:04
Albert8324-Jan-06 20:04 
GeneralRe: Can't make array class data shown in a label Pin
AB777124-Jan-06 20:54
AB777124-Jan-06 20:54 
GeneralRe: Can't make array class data shown in a label Pin
Guffa23-Jan-06 20:41
Guffa23-Jan-06 20:41 
GeneralRe: Can't make array class data shown in a label Pin
Albert8324-Jan-06 9:41
Albert8324-Jan-06 9:41 

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.