Click here to Skip to main content
15,885,842 members
Home / Discussions / C#
   

C#

 
GeneralRe: Install Windows Service Pin
Kevin Marois30-Mar-15 3:29
professionalKevin Marois30-Mar-15 3:29 
GeneralRe: Install Windows Service Pin
Dave Kreskowiak30-Mar-15 3:58
mveDave Kreskowiak30-Mar-15 3:58 
GeneralRe: Install Windows Service Pin
Kevin Marois30-Mar-15 3:59
professionalKevin Marois30-Mar-15 3:59 
AnswerRe: Install Windows Service Pin
Pete O'Hanlon30-Mar-15 2:42
mvePete O'Hanlon30-Mar-15 2:42 
GeneralRe: Install Windows Service Pin
Kevin Marois30-Mar-15 2:44
professionalKevin Marois30-Mar-15 2:44 
QuestionDbEntry Pin
Anele Ngqandu29-Mar-15 4:13
Anele Ngqandu29-Mar-15 4:13 
AnswerRe: DbEntry Pin
Dave Kreskowiak29-Mar-15 7:48
mveDave Kreskowiak29-Mar-15 7:48 
QuestionSelectednode.text is always null Pin
Member 1070832729-Mar-15 3:36
Member 1070832729-Mar-15 3:36 
I have made a context menu switch and a treeview! The context menu role is to delete the node on right click (from the delete button in menu of course) but the problem is that selectednode.text is always null! I want to get the text of the selected node and search in database to delete it from database! Here is the code
Treeview


C#
<asp:TreeView runat="Server" ExpandImageUrl="~/images/database.png" CollapseImageUrl="~/images/database.png" OnTreeNodePopulate="Node_Populate" ID="tvwauthors"  >

 <Nodes>

  <asp:TreeNode Text="Existing Database" PopulateOnDemand="true" Value="0" />

 </asp:TreeView>

  </div>



Context menu


C#
  <script type="text/javascript">
   var $b = jQuery.noConflict(true);
    $b(document).ready(function () {
        $b('#tvwauthors').vscontext({ menuBlock: 'vs-context-menu' });
    });
</script>


   <ul>
   <li class="delete">
   <span onclick="return confirm('Are you sure to delete?')">          
   <asp:Button Text="Delete" runat="server"  CausesValidation="false"     
   OnClick="delete"  style="width:70px;height:32px" /></span>
   </li>


event in aspx.cs file

C#
  protected void delete(object sender, EventArgs e)
{
    string nodeVal = tvwauthors.SelectedNode.Text;
 }


I'm aware that I should use TreeViewEventArgs but I'm calling the delete function from context menu so it's giving me system.handler error. I'm new to c# so kindly help me
QuestionHangMan C# need help! Pin
Munteanu Silviu28-Mar-15 7:21
Munteanu Silviu28-Mar-15 7:21 
AnswerRe: HangMan C# need help! Pin
Sascha Lefèvre28-Mar-15 8:23
professionalSascha Lefèvre28-Mar-15 8:23 
AnswerRe: HangMan C# need help! Pin
Bjørn8-Apr-15 4:24
Bjørn8-Apr-15 4:24 
QuestionPPPoe connection creation in c# Pin
KARFER28-Mar-15 4:00
KARFER28-Mar-15 4:00 
Questionlocalazation simulation Pin
huthiafa27-Mar-15 23:33
huthiafa27-Mar-15 23:33 
GeneralRe: localazation simulation Pin
Richard MacCutchan27-Mar-15 23:57
mveRichard MacCutchan27-Mar-15 23:57 
QuestionGlobal variable in C# Pin
aahamdan27-Mar-15 23:24
aahamdan27-Mar-15 23:24 
AnswerRe: Global variable in C# Pin
OriginalGriff28-Mar-15 0:27
mveOriginalGriff28-Mar-15 0:27 
GeneralRe: Global variable in C# Pin
aahamdan4-Apr-15 4:07
aahamdan4-Apr-15 4:07 
GeneralRe: Global variable in C# Pin
OriginalGriff4-Apr-15 4:26
mveOriginalGriff4-Apr-15 4:26 
AnswerRe: Global variable in C# Pin
Afzaal Ahmad Zeeshan28-Mar-15 17:32
professionalAfzaal Ahmad Zeeshan28-Mar-15 17:32 
GeneralRe: Global variable in C# Pin
aahamdan4-Apr-15 4:06
aahamdan4-Apr-15 4:06 
QuestionMobile agent data gathering in WSNs Pin
huthiafa27-Mar-15 22:25
huthiafa27-Mar-15 22:25 
QuestionEnumeration in C#,Different Input returning Same enumeration Pin
KK Kod27-Mar-15 5:01
KK Kod27-Mar-15 5:01 
AnswerRe: Enumeration in C#,Different Input returning Same enumeration Pin
Sascha Lefèvre27-Mar-15 5:16
professionalSascha Lefèvre27-Mar-15 5:16 
GeneralRe: Enumeration in C#,Different Input returning Same enumeration Pin
KK Kod27-Mar-15 5:25
KK Kod27-Mar-15 5:25 
AnswerRe: Enumeration in C#,Different Input returning Same enumeration Pin
Eddy Vluggen27-Mar-15 5:22
professionalEddy Vluggen27-Mar-15 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.