This is a migrated thread and some comments may be shown as answers.

VB.net question on rad objects

4 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fabio
Top achievements
Rank 1
Fabio asked on 14 Jun 2011, 11:11 AM
hi! i would like to know what do i have to add to .aspx.vb pages so that i can create rad objects like this:

Dim rw As New RadWindow
 I tried to import Telerik.Web but is didn't do anything. I'm trying to create a new window when i click on a button and if necessary to pass some arguments to that same page that this new window is going to open.
I appreciate any help.

Fábio


(SOLVED PART ABOUT Import) - > imports Telerik.Web.UI

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jun 2011, 11:54 AM
Hello Fabio,

I suppose you want to open a RadWindow in a button click. If that is the requirement, here is the sample code that I tried. Hope this helps.

VB:
Protected Sub Button4_Click(sender As Object, e As EventArgs)
    Dim windowMgr As New RadWindowManager()
    Dim newwindow As New RadWindow()
    newwindow.ID = "OpenRadWindow1"
    RadWindow1.Width = Unit.Pixel(800)
    RadWindow1.Height = Unit.Pixel(200)
    RadWindow1.VisibleOnPageLoad = True
    windowMgr.Windows.Add(newwindow)
    Me.form1.Controls.Add(windowMgr)
End Sub

Thanks,
Princy
0
Fabio
Top achievements
Rank 1
answered on 15 Jun 2011, 09:30 AM
Hello Princy,

Thanks for the code i saw some in one of the tutorials on how to open and window by clicking in another object my real problem was that where i had " Dim rw As New RadWindow" is was giving me an error that it could recognize the radWindow object i manage to understand is was the lack of the " Imports Telerik.Web.UI".

My question now is how can i pass information from the page where is the button i click to the window that i'm opening. Here goes an example to see if i can explain better what i want.

Imagine you have a website about cars and that your website have some webpages like car ( where you can search for a car our specific parts of a car like the wheels, engine etc.) and another webpage about the engines where you have more information.
Say you are in the webpage about cars and that you select an engine in the respective dropbox. Say now that you want to now more about that engine and that at the right-side of the dropbox there is a button that goes to the webpage engines. How can i pass the information of the selected engine (in the respective dropbox) to the new window opened by the button so that i can go to a database and get the information about that engine?

I hope you can understand my text XD altought, if it is too confusing i can put an example with images.

Many thanks,
Fábio
0
Shinu
Top achievements
Rank 2
answered on 15 Jun 2011, 11:15 AM
Hello Fabio,

You can use the window URL to pass parameters that are read on the server-side to configure the controls inside the window. See the code snippet below.

C#:
protected void Button1_Click(object sender, EventArgs e)
{
   . . . . . . . . . . .
    RadWindow winwdw = new RadWindow();
    winwdw.NavigateUrl = "ServerCode_window.aspx?id=" + id + "&Name=" + name + "&orgid=" + orgid; // Set Url with parameters
      . . . . . . . . . . . 
}

In the dialog page you can access the parameters that you send from the Request object in the Page_Load method.

Check out the following demo for more on this.
Window / Using the URL for Server Arguments.

Thanks,
Shinu.
0
Fabio
Top achievements
Rank 1
answered on 16 Jun 2011, 09:42 PM
Hi Shino!

Thank you for the help it does the trick but i wonder about security. If i do things with URL everyone has access to the information and might be able to change it. It is very important that thing run as safe as possible. I could hide the URL bar? of the windows i open but still that is just not showing what the most people know. Isn't there a more secured way of passing arguments to the new window and the other way around?

thanks,
Fábio
Tags
General Discussions
Asked by
Fabio
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Fabio
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or