|
Yes above example is fine if you are using class then put that class in folder app_code
and if you will use
public static void abc()
{
code goes here........
}
in class xyz
then you can access method just by typing xyz.abc();
also you can define your functions in the web page
either using private or protected key wordd
private or protected void abc()
{
code goes here......
}
if you need further assistance dont hesitate to ask.
Naveed Kamboh
|
|
|
|
|
What exactly you want to do buddy... If you want to use nodes as links then use sitmap as the datasource.
|
|
|
|
|
hi. i want the user to select one of the nodes then after filling another fields he click the submit button so i can insert the value of these fields and the selected node value in the table i don't wnat the page to post back when the user select the node.
|
|
|
|
|
Hi,
We have 3 servers, under each servers certain applications(20 applications) are launched. For all these applications the authentication is to be done once(Single-Sign on). But, in case if users session is timeout in one application on one server, how the other applications in other servers can sense the same.
Give some soution for this.
P. Mohan
|
|
|
|
|
I have the solution if two buttons are there differently,but is it possible in a same button.if i click add then save,if i click update then save.add and update code can we write in the same button,if how
kissy
kissy
|
|
|
|
|
I am not able to understand from your message what you are trying to do. I understand that you have two buttons, but I don't understand how you want to change that.
Do you want two buttons that use the same code, or one button that does different things, or one button that does two things?
---
b { font-weight: normal; }
|
|
|
|
|
i want same two has to do different things.please
kissy
|
|
|
|
|
Hi
If u want two different things to do at two different time, I can suggest a solution.
When a record is to be edited, change the text of the button as "Update", and in the same manner, when a new record is to be inserted ,Change the Text of the button as "Insert".
Then on the server side use the Text property of the button to determine what action needs to be taken.
Ex:
On Server Side:
In onButtonClick function you check
switch(button1.text )
{
case"Update":
// Update Block
break;
case"Insert":
//Insert Block
break;
}
I don't know exactly if it'll help you or not. But if you provide me some more information, then i can suggest you something good.
Irshad Ahmad
|
|
|
|
|
ya i had Add,update,save buttons.i have given code differently for both add and update,my problem is i have to call these two functions in save button.after adding a new record i give save,after update also i give save,
so my problem is i need to give code in save button as per the actions i am doing.please if understand give me reply,
thanks for ur answer
kissy
|
|
|
|
|
Probably the answer is same put the update functionality in a function and call that function when you are done with insert in the same button.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Ok...
Now I understand it. I would suggest you to take a static string say strSaveMode. Assign its value as "Add" on Add button click or if Update button is clicked then assign its value as "Update".
On clicking on Save button check the value of strSaveMode.If it is "Add" then call Add block of code. If it is Update then call Update block code.
Example:
Let cmdAdd,cmdUpdate and cmdSave are three buttons.
Declare a string at the class level like:
static string strSaveMode = "";
Now, In cmdAdd button click method:
-----
strSaveMode = "Add" ;
-----
-----
Similarly ,
write
In cmdUpdate button click method:
-----
strSaveMode = "Update" ;
-----
-----
Then in cmdSave button click :
-----
if(strSaveMode == "Add")
// Add Block
else if (strSaveMode == "Update")
//Update Block.
Hope it works.;)
Irshad Ahmad
|
|
|
|
|
ya but it is working only for some function ie add,both are not working,code is as you have given.help me out,wats the wrong with my code.
kissy
|
|
|
|
|
If possible,Please send me the code snippet u r using.....May be I can help you.
Irshad Ahmad
|
|
|
|
|
i have seperate code for both insert and update,i called as below.it only works for insert not for update.
try to understand and give me solution
Public Sub saveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
If savemode = "updte" Then
updat()
Else
insrt()
End If
End Sub
//same for the update button with modifications
Public Sub Add_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add_Button.Click
Page.RegisterStartupScript("SetFocus", "document.getElementById('" & nameBox.ClientID & "').focus();")
updat_Button.Enabled = False
savemode = "Add"
End Sub
kissy
|
|
|
|
|
It looks fine.
I hope u'd written like this for update button
Public Sub Update_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add_Button.Click
Page.RegisterStartupScript("SetFocus", "document.getElementById('" & nameBox.ClientID & "').focus();")
add_Button.Enabled = False
savemode = "updte"
End Sub
If after this also , it is not working, please check that save mode variable has been declared as 'static' (I guess in VB.net , it'll be 'shared').
Hope it works....
Irshad Ahmad
|
|
|
|
|
there is no static varible declaration in asp.net.i am using asp.net with vb.
how to do this ,plz help me out .how to declare
kissy
|
|
|
|
|
Private Shared strSave As String
Instead of static variable we have shared variable in VB.net.
I hope it will surely work.
Irshad Ahmad
|
|
|
|
|
Hi
In VB.net we have shared variable which does the same work as static in c#.net.
Please check it.If doesn't work ,I'll suggest another method which although works fine butu is an overhead performance wise.;)
Irshad Ahmad
|
|
|
|
|
Little pseudocode:
Sub Save_Click
DoSave()
End Sub
Sub Update_Click
DoSave()
DoUpdate()
End Sub
private Sub DoSave()
'Some code
end sub
private Sub DoUpdate()
'Some other code
end sub
|
|
|
|
|
Hi Friends,
I want to add controls dynamically to the form at any position as i wish.For that i want to identify the location on the form(page).How to do it in asp.net 2.0 . I know that so many talented people are here to help us.Please post a better solution for this as soon as possible.
Thankyou to one and all,
Regds,
Hari.
|
|
|
|
|
Hi Friends,
This is HariBabu, I want to drag items from one listbox and drop it in another listbox. I want code for this fuctionality in asp.net with c#. i know so many talented guys are here to help me.
Thankyou Guys(Also Ladies)
Regds,
Hari.
HariBabu Kuricheti
|
|
|
|
|
I am using a Javascript dropdown menu on my page. The drop down is dynamically added during page load an it works fine. The only issue is that, if there are any dropdownlist, listbox controls, the javascript menu is displayed behind the controls.
|
|
|
|
|
is it possible folder browsing using TreeView Control?
samir
|
|
|
|
|
Hi ,
I tried out the sample in
www.codeproject.com/useritems/neuralnetwork.asp[^]
I went through it and implemented.
I have doubts.When i executed the code,i loaded some of the bmp files for Pattern Detection and trained it for 1000 times.[say 8 images ,out of which 4 are same image only]
But it threw error while detection that
"Invalid input Image?Number of inputs doesnot match the number of neurons in the input layer".
Also there they have asked to give ascii value for the image.If i have selected the bmp file of a flower,what could be its ascii value?
How many input patterns i have to load?
please help me....
|
|
|
|
|
Hello:
I am now creating an excel file using xslt with the code below:
dim objFsXML as System.IO.StringReader
dim objXmlTxtWrt as System.Xml.XmlTextReader
dim objXPath as System.Xml.Xpath.XpathDocument
dim objXslTran as System.Xml.Xsl.XslTransform
'Create Output Stream to write the file to disk
objFsXML = New System.IO.FileStream(strExcelFile,System.IO.FileMode.Create)
objXmlTxtWrt = New XmlTextWriter(objFsXML,System.Text.Encoding.Unicode)
'Create Xpath Doc to be given as used while doing the XSL Trannsfor
objStrRdr = New StringReader(dsDataSet.GetXml)
objXmlTxtRdr = New XmlTextReader(objStrRdr)
objXPath = New XPath.XPathDocument(objXmlTxtRdr)
objXslTran = New Xsl.XslTransform
objXslTran.Load(strXSLTempFile)' here throws exception
However, when there is a blank or a special char in one of my headers, i've got an invalid xpath expression which throw an exception
what can i do ?
thx
|
|
|
|