Help on session and viewstate

Posted by Vijayar under C# on 9/6/2011 | Points: 10 | Views : 1137 | Status : [Member] | Replies : 2
Hi
i am sending sms using c# .I am passing username,passwors,phonenumber,txtmessage to the object of the class.i am using templates to send message ,now my problem is i am not getting spaces between words in the message.i am using adapter to get message template from database and assigning it to txtmessage
I am writind code in ddlselectedindex changed event to get different templates
using the following code




string message = (ds.Tables[0].Rows[0][0].ToString());


string[] lines = message.Split(' ');



StringBuilder builder1 = new StringBuilder();
foreach (string safePrime in lines)
{
//s3 += safePrime + " ";
s3= builder1.Append(safePrime).Append('+').ToString();
txtmessage.Text = s3;



in button click.Now my problem is unable to add other than template message.I.e if max limit for message is 150 if message template length is 5 characters i am unable to add and send message.How to rectify this problem.Can we do this by using session or view state all should be in same page only

vijaya


Responses

Posted by: SheoNarayan on: 9/6/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Vijay,

Your problem has nothing to do with the session or viewstate. Its just matter of keeping the space.

First check that your database field has data with spaces or not, if it is not then you can't help out. It it is there, most probably you do not need to do anything or try to replace ' ' with " " in case of html string.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vijayar on: 9/7/2011 [Member] Starter | Points: 25

Up
0
Down
Hi
I am unable to add message to textbox to send other than template message .how to rectify this.Explain me

vijaya

Vijayar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response