8
Answers

Novice Requires Help - Web Reference - Classes

Andrew

Andrew

19y
2k
1
Hi,

I'm new to C# and need to make a Web Reference, this I've done and I can see the Class.

How do I make a reference to it in my code, do I use 'using .....'?

In the example of code for using it I have the following line: -

cpLatestBrief.authValue

there is now reference to 'cpLatestBrief', what should I do to correct this?

Hope this makes sense?

Regards
Answers (8)
0
kalu singh rao

kalu singh rao

NA 6.4k 63.9k 8y
You can check by this code
 
Method 1
 
if(!String.IsNullOrEmpty(txtContent.Text)){
// it is true
}
else
{
 // it is false
}
 
Method 2
 
 if(txtContent.Text != "")
{

}
 
Method 3

if (txtContent != string.Empty)
{

}
 
Accepted
0
Nilesh Sawardekar

Nilesh Sawardekar

NA 1.4k 15.2k 8y
Hello,
Thanks for accepting answer. For new question, ask same in new. with your code.
0
Joma Alrzini

Joma Alrzini

NA 61 7.9k 8y
thanks Kalu and Nilesh
I works fine but in my code above when I click on the button to submit to database the whole page is refreshed I do need to stop that I tried with updatepanel but I could not I read about ajax but I have no idea how to do it
please help me it f you have any example
I appreciate that very much
0
Nilesh Sawardekar

Nilesh Sawardekar

NA 1.4k 15.2k 8y
if you want to restrict user from saving when txtcontent is null then you can use validation control, else write your query in if (txtContent.text !="").