Click here to Skip to main content
14,423,178 members
   

C#

 
AnswerRe: i need a c# project using interfaces about anything Pin
Luc Pattyn13-Jan-20 2:03
sitebuilderLuc Pattyn13-Jan-20 2:03 
QuestionAccess winforms application when user right click on a file Pin
Hero201812-Jan-20 2:54
MemberHero201812-Jan-20 2:54 
AnswerRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 3:20
communityengineerOriginalGriff12-Jan-20 3:20 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 10:48
MemberHero201812-Jan-20 10:48 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 11:23
communityengineerOriginalGriff12-Jan-20 11:23 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 13:22
MemberHero201812-Jan-20 13:22 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 23:07
communityengineerOriginalGriff12-Jan-20 23:07 
QuestionHtmlAgilityPack - How to get the Value from the tag <div> into aspx.cs Pin
Member 1316600710-Jan-20 7:02
MemberMember 1316600710-Jan-20 7:02 
I have a task to do. I need to get the value from the tag into c#. I need to display the value into Label. This here is my HTML code:

<pre><div size="10" id="para1"></div>  <p></p><asp:Label ID="Label2" runat="server" Text="" Font-Size="XX-Large"></asp:Label><p></p><asp:Label ID="Label3" runat="server" Text="" Font-Size="XX-Large"></asp:Label>

<script>
document.getElementById("para1").innerHTML = formatAMPM();

    function formatAMPM() {
        var d = new Date(),

            days = ['sonday', 'monday', 'tuesday', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'];
        return days[d.getDay()];
    }</script>


from code behind i use this here to get the value but it does not work:
HtmlDocument page = new HtmlWeb().Load(@"D:\Downloads\wichtig\try\WebApplication1-Kopie-Kopie\MeineWebseite\löschen\WebForm2.aspx");
        var title = page.DocumentNode.SelectSingleNode("//div[@id='para1']");
        Label3.Text = title.ToString();

I only know how to get the tag by Id. This is how it works
document2.Load(@"D:\Downloads\wichtig\try\WebApplication1-Kopie-Kopie\MeineWebseite\löschen\WebForm2.aspx");

        string tag = document2.GetElementbyId("para1").Name;
        Label2.Text = tag;

That is how it works but I want Label3 should display the current date like

<div>id="para1</div>

The result is this here https://i.stack.imgur.com/wes2a.png
AnswerRe: HtmlAgilityPack - How to get the Value from the tag <div> into aspx.cs Pin
Richard Deeming10-Jan-20 7:10
communityengineerRichard Deeming10-Jan-20 7:10 
Questionhow to configure LED8 customer pole display? Pin
Member 122427179-Jan-20 23:13
MemberMember 122427179-Jan-20 23:13 
AnswerRe: how to configure LED8 customer pole display? Pin
OriginalGriff9-Jan-20 23:37
communityengineerOriginalGriff9-Jan-20 23:37 
AnswerRe: how to configure LED8 customer pole display? Pin
ZurdoDev10-Jan-20 2:01
mveZurdoDev10-Jan-20 2:01 
AnswerRe: how to configure LED8 customer pole display? Pin
Dave Kreskowiak10-Jan-20 5:19
mveDave Kreskowiak10-Jan-20 5:19 
AnswerRe: how to configure LED8 customer pole display? Pin
0x01AA10-Jan-20 9:11
professional0x01AA10-Jan-20 9:11 
QuestionHow can I accomplish this little project of mine. Pin
Mmm-Geralt9-Jan-20 8:37
MemberMmm-Geralt9-Jan-20 8:37 
AnswerRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 9:06
communityengineerOriginalGriff9-Jan-20 9:06 
GeneralRe: How can I accomplish this little project of mine. Pin
ZurdoDev9-Jan-20 9:51
mveZurdoDev9-Jan-20 9:51 
GeneralRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 10:33
communityengineerOriginalGriff9-Jan-20 10:33 
AnswerRe: How can I accomplish this little project of mine. Pin
Dave Kreskowiak9-Jan-20 11:19
mveDave Kreskowiak9-Jan-20 11:19 
GeneralRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 11:31
communityengineerOriginalGriff9-Jan-20 11:31 
GeneralRe: How can I accomplish this little project of mine. Pin
Mmm-Geralt2mins ago
MemberMmm-Geralt2mins ago 
Questionhow to open an application using button in C# Pin
Hernany Bondoc9-Jan-20 6:14
MemberHernany Bondoc9-Jan-20 6:14 
AnswerRe: how to open an application using button in C# Pin
Richard Deeming9-Jan-20 6:36
communityengineerRichard Deeming9-Jan-20 6:36 
QuestionHow to generate pdf files on C#?? Pin
hgsingla8-Jan-20 6:57
Memberhgsingla8-Jan-20 6:57 
AnswerRe: How to generate pdf files on C#?? Pin
Richard MacCutchan8-Jan-20 7:40
communityengineerRichard MacCutchan8-Jan-20 7:40 

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.