|
Hi Menon
Thanks for your quick reply
what i want to do is, details is follows
1. I have a button name btnSubmit on my page
2. when you click btnSubmit then it will check Text, DropdownList etc value
3. if the values are right then it will ask me wheather i want to submit this value are not?
4. if i click ok button then it will add data into server
5. if i click no then it show me message which will tell me, data wasnt added
now could you please tell me the best solution of this
any help and example will be greatful
waiting for ur reply
thanks in advace
Sarfarj Ahmed
|
|
|
|
|
javascript function something like:
<br />
function validateAndSubmit()<br />
{<br />
var validFalg = true;<br />
if(document.getElementById(dropdownlist).selectedIndex == -1 || document.getElementById(dropdownlist).selectedIndex == 0)<br />
{<br />
validFlag = false;<br />
}<br />
if(validFlag)
{<br />
var con = confirm("Are you sure you want to...");<br />
if(con)
return true;
else
{<br />
alert('data not saved');<br />
return false;<br />
}<br />
else
{<br />
alert('please select valid values');<br />
return false;<br />
}<br />
}<br />
}<br />
<br />
call the above function on button's client click like
asp:button id="mybtn" runat="server" onCLientClick="javascript:return validateAndSubmit()"
-----
|
|
|
|
|
HI Bhatti
thank you very much for your reply
i have done my field checking after that inside btn event i put
Protected Sub ibtnAddNewBooks_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibtnAddNewBooks.Click<br />
Dim _CheckingForm As Integer = CheckingFormForAddingBooks()<br />
<br />
If Not _CheckingForm = 0 Then<br />
ibtnAddNewBooks.Attributes.Add("OnClick", "javascript:return confirm('Are you sure you want to add this book informations?');")<br />
<br />
<br />
Else<br />
lblmessage.text= "Please Check Your Input Value" <br />
<br />
End If<br />
End Sub
but the problem is
Sarfarj Ahmed
|
|
|
|
|
Sarfraj you and I are not on same page. The code I suggested was to validate the form on the client using javascript, not on the server. From your code it seems that you are validating the form on the server side. If you want to do this way, I'll suggest the following:
Add a panel in the aspx page like this below lblmessage:
<asp:panel id="pnlYesNo" runat="Server" visible="false">
<asp:button runat="server" id="btnYes" text="Yes" />
<asp:button runat="server" id="btnNo" text="No" />
</asp:panel>
change your code as under:
If Not _CheckingForm = 0 Then
pnlYesNo.visible = true
lblmessage.text = "Are you sure you want add this book information?"
else
lblmessage.text= "Please Check Your Input Value"
pnlYesNo.visible = false
end if
Now in click event of No button, you will hide the panel like:
Protected Sub btnNo_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnNo.Click
pnlYesNo.visible = false;
lblmessage.text ="whatever you want"
End Sub
and in click event of Yes do this:
Protected Sub btnYes_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnYes.Click
// validate the form again in case user might have changed something
Dim _CheckingForm As Integer = CheckingFormForAddingBooks()
If Not _CheckingForm = 0 Then
// save the book info, display the message and clear the form
Else
// invalid values so display the message
lblmessage.text= "Please Check Your Input Value"
End If
End Sub
----- code for my previous solution
And, if you want to follow my previous code then you have to do this:
In pageload function do this:
<code>
ibtnAddNewBooks.Attributes.Add("OnClick", "javascript:return validateAndSubmit();")
</code>
now whatever you are doing in CheckingFormForAddingBooks function you will have to convert it to javascript and do it validateAndSubmit function. And on the server side in ibtnAddNewBooks_Click function you will save the books and display successful message.
-----
|
|
|
|
|
Hi all,
I am building a class where I have a sub calling my.settings like this:
Private Sub New()
oConn = New SqlConnection("Provider=" & My.settings.provider & ";" & "Datasource=" & _ My.settings.datasource & ";")
End sub
it has produced an error even though I am sure It shouldn't.
Does anyone have an idea as to how I can treat this.
Thanks
|
|
|
|
|
JMUREKEZI wrote: Does anyone have an idea as to how I can treat this.
Ignore it, because without the showing the error you are getting there is nothing that can be done.
only two letters away from being an asset
|
|
|
|
|
Hi,
It is part of a class that is used to create connection to the database.
Anyway thanks I figured out how to do it using
Dim esetting As ConfigurationSettings
Dim appSet As NameValueCollection
appSet = settings.AppSettings()
connectionString = appSet.Item("ConnectionString")
|
|
|
|
|
Hi All,
I have need to execute a SSIS package from the button click event in the Repeater. I am sending the e.CommandArgument which will use in the SSIS package.
Thanks in advance.
Sri..
|
|
|
|
|
Execute SSIS project from ASP.NET page
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
I tried using the Microsoft help, I am not really a decent programmer, the website we already have, is setup to function under an access database, we hired a SQL guy to bulid us the SQL tables we needed in SQL, trying to update the Webconfig to talk to the SQL server, I have failed at.
Is what I have tried to get my website to talk to the sql
<connectionStrings>
Line 17: <add name="DIMHRSDataCon" connectionString="Server=HOODNBOTC458827;Database=DIMHRS;Trusted_Connection=Yes;"/>
Line 18: </connectionStrings>
Here is our old webconfig file talking to the access database:
<appSettings>
<add key="DIMHRSDataCon" value='Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=C:\Projects\DIMHRS\Database\DIMHRS.mdb;'/>
<add key="DIMHRSTreeviewCon" value='Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=C:\Projects\DIMHRS\Database\PA.mdb;'/>
</appSettings>
Can anyone tell me how to setup my webconfig file? So I can work on the SQL server? Using Visual Studio 2003, .NET 1.1
|
|
|
|
|
Ibuprofen wrote: Webconfig + SQL Server 2003
AFAIK, There is no SQL Server 2003.
Ibuprofen wrote: <connectionstrings>
Line 17: <add name="DIMHRSDataCon" connectionstring="Server=HOODNBOTC458827;Database=DIMHRS;Trusted_Connection=Yes;">
Line 18:
If you are using .NET 1.1, there is no connectionstrings tag so you should probably use appSetting for connectionstring of SQL
Example :
<br />
<appSettings><br />
<add key="DIMHRSDataCon" value='Server=HOODNBOTC458827;Database=DIMHRS;Trusted_Connection=Yes;'/><br />
</appSettings>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Sorry, I meant to type SQL Server 2000 and Visual Studio 2003. Thank you, that worked for me.
|
|
|
|
|
I am generating reports using the Report Viewer. I have 9 columns.
My problem is that the report is splitting into 3 when it is generated as a PDF,
it seems that only 4 columns is displayed on a page.
Anyone know how to fix this?
macca
|
|
|
|
|
maybe, you may change the size of page.. or make the small columns that can fix within a page..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hi
Mac
You can try to take a cell as a Table Instead Taking it as columns and Rows
If u r generating PDF then It is Sure it is going to Take a CEll As A TABLE
So Do it like this It may solve ur prob.
Just Do IT™ [Information Technology]™ :->
Don't Forget To Give Rating...
|
|
|
|
|
Thnaks for the reply Gandalf but how do I do this.
Do you have any examples?
macca
|
|
|
|
|
hi friend's
there are 3 div tag in my page that i use these for simulate tab menu.
in my page when a user click first button ,first div is appear and so...
this ation do with javascript.
but my problem is that: i have on third div a button that when a user click on it
my page reload from server and then my first div appear agein but the third div must be shown.
please tell me your idea for solving this problem.
thank you.
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
mr.mohsen wrote: i have on third div a button that when a user click on it
Why does the page get the postback when the user click on the third DIV?
If you wanna use the tabs in your page, you may try using Nifty Corners Cube.
You can check-out this link below to know how to use Nifty Corner as a tab..
Example 4: nifty tabs
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
delegates i know is a safe type function pointer. y should i use it , i am not getting it's utility , the same thing can happen if i directly call the funciton , then what's the need to incorpoate the delagates?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Sonia Gupta wrote: y should i use it
Delegates are used for function callback. It is used in event handling.
Sonia Gupta wrote: the same thing can happen if i directly call the funciton
Using delegates, you are setting a function reference which has to be called. It can be used for information passing between classes.
|
|
|
|
|
I have a GridView that is used to edit hours. However, if there are several rows, when I click on the edit button, the page comes back to the top and I have to scroll back down to find the selected/highlighted row. Is there a way to where that does not need to occur? I would like the focus to show up on that textbox control and be at that row no matter where it is on the page, is this possible?
Thanks
|
|
|
|
|
use SmartNavigation on your page...
u can search about use smart navigation...
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
hello all,
i got a very serious problem and i need to add http header to each client request i make to a webservice. so my question is how can i add a custom http header to the request? as .net generates wsdl and hide the httprequest object? i wanna see how to access the base httprequest object and add the header i want.
thank you
marcoryos
|
|
|
|
|
How to dynamically generate controls and values of entire web page and every thing (all control types like button or text box .. and their values) comes from databasein asp.net 2.0.
|
|
|
|
|
The following code may b helps you
This is just an idea you can change into this as your needs..
protected override void Render(HtmlTextWriter writer)
{
for (int i = 0; i < datatable.rows.count; i++)
{
Image img = new Image();
img.ImageUrl = string.Format("image1.gif");
img.AlternateText = "My Image";
writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, "center");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
img.RenderControl(writer);
writer.WriteBreak();
writer.Write(todayWeather.ToString());
writer.RenderEndTag();
}
}
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|