|
Here i am using the following javascript for alert a msgwindow.problem is, it is opening new page and giving the message,How to alert the same in the same page??It is happening on a button click event.
--->
if txt1.text="" then
Response.Write(" alert(' Enter username,it shd not be null '); ")
end if
kissy
|
|
|
|
|
try this one
response.write(" ....)
|
|
|
|
|
Both are giving same result.my requirement is the message shd be displayed on the same form,not like response.write()
.It directs to different page.
kissy
|
|
|
|
|
u should add attributes on the button click add following code on your html page
<br />
<script language=javascript><br />
function chktxt()<br />
{<br />
if (document.getEelementById("textbox1").value='')<br />
{<br />
alert('Enter Some Value');<br />
}<br />
}<br />
</script><br />
and add following code on your .vb page in page_load event
<br />
button1.attributes.add("onclick","return chktxt();")<br />
check and reply me quick
|
|
|
|
|
This is working perfectly.
But my doubt here is,this is working for testing textboxes,
If i want to display after Add_Button,i am displaying message "Records were added",here i am dipslaying with a label.In this case can i display by using script for simply " Records were added"
kissy
|
|
|
|
|
tell me what exactly u want!
|
|
|
|
|
sd1 = "Insert into Producing_Agency(pa_id,pname)values(1,'"&txtname.text&"')
pains = New SqlCommand(sd1, dbconn)
pains.ExecuteNonQuery()
Lbldisplay.Text = "Record Added"
Here i am using Lbldisplay for displaying the message in the same form.
can i disply by using the below in the same form ,
Response.Write(" alert(' Record inserted '); ")
my doubt is Reposne.write means,this message is displying in other page.It directs otherpage.This is my doubt.
kissy
|
|
|
|
|
No, Kissy
response.write meanse writing some text on the same page
as you wrote code i tried the same to my page but i got the message on the same page,
it didn't redirected me any other page.
i think you must check your .aspx page code.
Regards
Ravi
|
|
|
|
|
Use this....enjoy
RegisterClientScriptBlock("Alert", "alert('Purchase Invoice save successfully')");
Dinesh Sharma
Team Leader (Software Development)
|
|
|
|
|
Thanks for ur answer,But both are working same,No change,any way i will use any of them
Thanks once again.
kissy
|
|
|
|
|
Try using a Server side Label
label1.Text = "Textbox Error";
label1.Visible = false;
if(error)
Label1.Visible = true;
keep Learning and you never will be out of date...
|
|
|
|
|
use this:
Page.RegisterStartupScript("MyScript(any script name)", "alert('Message...');"
|
|
|
|
|
|
Bcoz C# gives machine level access
c# have all the vb.net functionality but vb.net doesn't
|
|
|
|
|
The best language for you is the one that you write the best code in. It doesn't matter how good a language is if you can't use it.
When it comes to performance or capabilities, the differences between VB.NET and C# is not that big.
Personally I prefer C# mostly because of the structure of the language, and the strict type checking. VB lets you get away with automatic conversions that really isn't good for you.
For example, this works in VB:
Dim Cnt As String<br />
Cnt = 1<br />
Cnt = Cnt + 1
The result is that the string Cnt now contains "2" as VB automatically converts the value back and forth between strings and integers, so it works more or less as intended. The problem is that the conversions makes the code take about 600 times longer than if you would have used an integer variable instead. Imagine if you use this is a loop...
Of course C# doesn't let you write such garbage.
---
b { font-weight: normal; }
|
|
|
|
|
You also have operators that do one thing, and one thing only:
e.g. in VB.net, this:
<br />
"A string " & " concatenated."
works the same as this:
"A string " + " also concatenated."<br />
Which makes it interesting when you take Guffa's post about implicit conversion of numbers etc...
|
|
|
|
|
Silly answer, but very much true: vb.net is WORDY as he#$. I can easily identify different blocks of code in a c# document thanks to the symbol usage, but not in vb (IF... ENDIF... what's up with that?!?). Also, its syntax is close to c++ and java, so it keeps my skills functional on all those languages. Besides, if you want to be a "marketable" programmer, stick with c#, they get more/better opportunities.
Nila
"...for that, I will need a large cup of coffee and a brand muffin!" -Samantha Bea
|
|
|
|
|
This is an age old debate and there are countless examples of this debate on the internet.
my advice to you, is that both languages use the .NET framework, so
in essence niether are any better than each other. At the end of the day the language choice is that of the developer as to what syntax they prefer.
I personally use both on a daily basis, and don't really care which one I use. It is up to the client as to which one they prefer to support and what skills they have in house to support the application.
|
|
|
|
|
Hi,
I have a datagrid and I also have Edit command by which I
am editing the data present in the datagrid. I have bound
my columns with the help of BoundColumn.
While Update, I want to validate the contents in the
textbox and want to use validators but since there is no
text box control (as asp.net internally generates Text box
by default) which I can specify in validator, how to
validate?
|
|
|
|
|
nabeelkhan wrote:
(as asp.net internally generates Text box by default
Its no magic.
If you look at the HTML source of your .aspx file, you will see a EditItemTemplate where a textbox is defined.
You can add your validator in that template so that it is added to the HTML when user presses Edit button.
Shreekar
http://shreekarishere.blogspot.com
|
|
|
|
|
Hi,
i have textboxces in datagrid control now i want to validate these textboxces through javascript fucntion ,,kindly help me in this above regard
waiting for ur resposes
|
|
|
|
|
u can use validators like Regular expression validator etc in asp.net
|
|
|
|
|
Hi friends !
I tested my aspx page on local host and its perfectly running. I host that page in the Internet,and when I tried to open that aspx page It shows an error message ie Server'\'error......
Even I upload all supporting files such as bin global.aspx web config....etc
please help me friends
demane'
|
|
|
|
|
HI
First check which version of asp.net u r using either asp.net1.1 or asp.net2.0.
check your webserver on internet supports your asp.net version.if its correct everything work fine..
Regards
R.Palanivel
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
On ur webspace where u are uploadiong the site check that ur hosting service providers have enabled asp.net for ur website or not if not then change ur web hosting settings and enable it
|
|
|
|