Tag Archives: Visual Studio

How to access ASP.NET Controls from code-behind inside a LoginView control

I almost created a completely new project as i thought it was one of those unexplained Visual Studio phenomenons. As a last measure I consulted Dr.Google and voila!

The following example holds true for any control, just make sure to add the corresponding attributes and values for casting.

(All codes in VB,NET)

To access a TextBox Control

Dim tbox As TextBox = DirectCast(LoginView1.FindControl("TextBox3"), TextBox)
tbox.Text = "WOW"

To access a Image Control

Dim picture As Image = DirectCast(LoginView1.FindControl("img1"), Image)
picture.ImageUrl = "pics/thumbs/what.png"

To access a Label Control

Dim labelname As Label = DirectCast(LoginView1.FindControl("label1"), Label)
labelname.Text ="last"
Advertisements
Tagged , ,

Visual Studio 2013: The System Cannot Find The File Specified. (Exception From HRESULT: 0x80070002)

I clicked Create New Project, and accepted all the defaults: New Project Application Defaults

However, immediately following pressing the Create Project button above, I get this message:

The system cannot find the file specified. (Exception from HRESULT: 0x80070002) Error message

To get this resolved you need to do the following:

  • Within VS, Tools > Extensions and Updates

VS-01

  • Expand Online and choose Visual Studio Gallery

VS-02

  • Search for NuGet Package Manager for Visual Studio

VS-03

  • Download and install
  • Restart VS

VS-04

  • Create your project and error will disappear and you will have files in the Solution Explorer

Via Just another IT blog

Tagged ,