How do I set an ASP.NET Label text from code behind on page load?

前端 未结 7 1721
终归单人心
终归单人心 2020-12-03 07:39

I can\'t seem to find an answer out there for this. Here\'s the scenario: I have an ASP.NET project using C#. I\'m loading data (Username, email, etc...) from a sqlite datab

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 08:08

    I know this was posted a long while ago, and it has been marked answered, but to me, the selected answer was not answering the question I thought the user was posing. It seemed to me he was looking for the approach one can take in ASP .Net that corresponds to his inline data binding previously performed in php.

    Here was his php:

    Here is the username:

    Here is what one would do in ASP .Net:

    Here is the username: <%= GetUserName() %>

提交回复
热议问题