Click here to Skip to main content
15,895,256 members
Home / Discussions / C#
   

C#

 
AnswerRe: i need a c# project using interfaces about anything Pin
Luc Pattyn13-Jan-20 1:03
sitebuilderLuc Pattyn13-Jan-20 1:03 
QuestionAccess winforms application when user right click on a file Pin
Hero201812-Jan-20 1:54
Hero201812-Jan-20 1:54 
AnswerRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 2:20
mveOriginalGriff12-Jan-20 2:20 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 9:48
Hero201812-Jan-20 9:48 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 10:23
mveOriginalGriff12-Jan-20 10:23 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 12:22
Hero201812-Jan-20 12:22 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 22:07
mveOriginalGriff12-Jan-20 22:07 
QuestionHtmlAgilityPack - How to get the Value from the tag <div> into aspx.cs Pin
Member 1316600710-Jan-20 6:02
Member 1316600710-Jan-20 6: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:

ASP.NET
<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:
C#
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
C#
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 6:10
mveRichard Deeming10-Jan-20 6:10 
Questionhow to configure LED8 customer pole display? Pin
Member 122427179-Jan-20 22:13
Member 122427179-Jan-20 22:13 
AnswerRe: how to configure LED8 customer pole display? Pin
OriginalGriff9-Jan-20 22:37
mveOriginalGriff9-Jan-20 22:37 
AnswerRe: how to configure LED8 customer pole display? Pin
ZurdoDev10-Jan-20 1:01
professionalZurdoDev10-Jan-20 1:01 
AnswerRe: how to configure LED8 customer pole display? Pin
Dave Kreskowiak10-Jan-20 4:19
mveDave Kreskowiak10-Jan-20 4:19 
AnswerRe: how to configure LED8 customer pole display? Pin
User 1106097910-Jan-20 8:11
User 1106097910-Jan-20 8:11 
QuestionHow can I accomplish this little project of mine. Pin
Mmm-Geralt9-Jan-20 7:37
Mmm-Geralt9-Jan-20 7:37 
AnswerRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 8:06
mveOriginalGriff9-Jan-20 8:06 
GeneralRe: How can I accomplish this little project of mine. Pin
ZurdoDev9-Jan-20 8:51
professionalZurdoDev9-Jan-20 8:51 
GeneralRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 9:33
mveOriginalGriff9-Jan-20 9:33 
AnswerRe: How can I accomplish this little project of mine. Pin
Dave Kreskowiak9-Jan-20 10:19
mveDave Kreskowiak9-Jan-20 10:19 
GeneralRe: How can I accomplish this little project of mine. Pin
OriginalGriff9-Jan-20 10:31
mveOriginalGriff9-Jan-20 10:31 
GeneralRe: How can I accomplish this little project of mine. Pin
Mmm-Geralt20-Jan-20 13:47
Mmm-Geralt20-Jan-20 13:47 
Questionhow to open an application using button in C# Pin
Hernany Bondoc9-Jan-20 5:14
Hernany Bondoc9-Jan-20 5:14 
AnswerRe: how to open an application using button in C# Pin
Richard Deeming9-Jan-20 5:36
mveRichard Deeming9-Jan-20 5:36 
QuestionHow to generate pdf files on C#?? Pin
hgsingla8-Jan-20 5:57
hgsingla8-Jan-20 5:57 
AnswerRe: How to generate pdf files on C#?? Pin
Richard MacCutchan8-Jan-20 6:40
mveRichard MacCutchan8-Jan-20 6: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.