Showing posts with label fancy. Show all posts
Showing posts with label fancy. Show all posts

Saturday, March 24, 2012

Newbie help - from C# --> VB

Can anyone please help me converting this simple C# to VB?
Many thanks in advance! Still trying to get into this fancy smancy
ASP .NET thingy from classic ASP :-0

**************************************************
private string _currentPage;

public string CurrentPage
{
get
{
return _currentPage;
}
set
{
_currentPage = value;
}
}

protected void Page_Load( object sender, EventArgs e )
{
if (CurrentPage != null)
{
WebControl currentPageControl = (WebControl)this.FindControl( CurrentPage );
}
}
*************************************************Hi,

taken thisC# to VB.NET converter it displayed this output:


Public Class abcd
Private _currentPage As String

Public Property CurrentPage() As String
Get
Return _currentPage
End Get
Set
_currentPage = value
End Set
End Property

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not (CurrentPage Is Nothing) Then
Dim currentPageControl As WebControl = CType(Me.FindControl(CurrentPage), WebControl)
End If
End Sub

BTW, if you post some code please use the tags that are used on these forums:view post 98605.

Grz, Kris.
Not too sure about the last line, as I'm not sure what you're trying to do, but:


Private strCurrentPage As String

Public Property CurrentPage() As String
Get
Return strCurrentPage
End Get
Set(ByVal Value As String)
strCurrentPage = Value
End Set
End Property

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If CurrentPage <> "" Then
' Whatever the last line does
End If
End Sub

Is that right?
Thanks to you both - just what I needed!
Will try to remember that code tag the next time :-)

Newbie here need some help..

Hi guys, i am new so please dont be too hard on me.. basically i wantto build a restaurant website, nothing too fancy, photo galley,news,mailing lists, etc.. was looking at the club startkit and building onthat. Now i would like the restaurant manages to update the site as andwhne they wnat to, is it possible to creat an application they can runon there pc, while will connect to the database on the site andeffectivly make changes required.
Basically do you have any advice on how i should go about it
Thanks
Zim
This is possible there are 2 ways of doing so.
A) Create an administration section that has a few pages to modify the prices / items/ personel information or whatnot
B) Integrate a CMS (content management solution) that will modify the xml or html or aspx directly and save it.
If you are interested in B Telerik RAD has a nice set of controls , one of them being a cms solution. If you want a cost effective solution
get a good book on ado.net look at the update/delete/ insert and create a simple admin section with a login.
Good luck with your site.