CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.dotnetnuke.custom_modules Tags:
Item Type: NewsGroup Date Entered: 8/6/2005 11:32:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 0 Views: 10 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
19 Items, 1 Pages 1 |< << Go >> >|
autolibse
Asp.Net User
Passing username in a Url Of Links Module8/6/2005 11:32:59 PM

0/0

I want to pass the username logged on using the Links Module to another website. How can I access the username or any user field for that matter in the Links Module?
DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/7/2005 4:10:18 AM

0/0

Here is a snippet which I've used to give all kinds of information about the current User.

            Dim s As String
            Dim objUsers As New UserController

            Dim objUser As UserInfo = objUsers.GetUser(UserInfo.PortalID, UserInfo.UserID)
            s = "<table cellpadding=" & Chr(34) & "4" & Chr(34) & "bordercolor=" & Chr(34) & "teal" & Chr(34) & "bgcolor=#ffffc0 border=" & Chr(34) & "2" & Chr(34) & ">"
            s = s + "<tbody>"
            s = s + "<tr><td><b>" & "Variable" & "</b></td><td><b>" & "Value" & "</b></td></tr>"
            s = s + "<tr><td>" & "UserInfo.UserID" & "</td><td>" & UserInfo.UserID.ToString() & "</td></tr>"
            s = s + "<tr><td>" & "UserInfo.PortalID" & "</td><td>" & UserInfo.PortalID.ToString() & "</td></tr>"
            s = s + "<tr><td>" & "FirstName" & "</td><td>" & objUser.FirstName & "</td></tr>"
            s = s + "<tr><td>" & "LastName" & "</td><td>" & objUser.LastName & "</td></tr>"
            s = s + "<tr><td>" & "Street" & "</td><td>" & objUser.Profile.Street & "</td></tr>"
            s = s + "<tr><td>" & "City" & "</td><td>" & objUser.Profile.City & "</td></tr>"
            s = s + "<tr><td>" & "Region" & "</td><td>" & objUser.Profile.Region & "</td></tr>"
            s = s + "<tr><td>" & "PostalCode" & "</td><td>" & objUser.Profile.PostalCode & "</td></tr>"
            s = s + "<tr><td>" & "Country" & "</td><td>" & objUser.Profile.Country & "</td></tr>"
            s = s + "<tr><td>" & "Unit" & "</td><td>" & objUser.Profile.Unit & "</td></tr>"
            s = s + "<tr><td>" & "Telephone" & "</td><td>" & objUser.Profile.Telephone & "</td></tr>"
            s = s + "<tr><td>" & "Cell" & "</td><td>" & objUser.Profile.Cell & "</td></tr>"
            s = s + "<tr><td>" & "Fax" & "</td><td>" & objUser.Profile.Fax & "</td></tr>"
            s = s + "<tr><td>" & "Website" & "</td><td>" & objUser.Profile.Website & "</td></tr>"
            s = s + "<tr><td>" & "IM" & "</td><td>" & objUser.Profile.IM & "</td></tr>"
            s = s + "<tr><td>" & "TimeZone" & "</td><td>" & Str(objUser.Profile.TimeZone) & "</td></tr>"
            s = s + "<tr><td>" & "PreferredLocale" & "</td><td>" & objUser.Profile.PreferredLocale & "</td></tr>"



-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/27/2005 8:48:39 PM

0/0

I setup a small module to retrieve the users values. How can I:

Open a webpage in a new window passing the users name and id in a querry string
DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/29/2005 1:31:34 PM

0/0

autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/29/2005 7:17:08 PM

0/0

But how can I open a new window and pass variables? 
DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/29/2005 9:09:33 PM

0/0

There's more than one way to do that.  Depends on how you want to go.  Here's one I use all the time.
First, I went to my "js" directory and included the following file called newwin.js having code :

<!-- hide this script from old browsers

// http://powerhousedata.com
// This script opens a new browser window and writes
// HTML to display an image with a title and caption

function show_view(pFileName,pTitle,pCaption,pScrolling) {
// create iframe html with pFileName inside of it
var s1 = '<IFRAME NAME=\"I1\" SRC=\"';
var s2 = '\" HEIGHT=\"450px\" WIDTH=\"750px\" TITLE=\"Cascading Style Sheet Results\" ALIGN=\"middle\" STYLE=\"border: 2px solid #666666\" SCROLLING=\"';
var s3 = " Your browser does not support inline frames or is currently configured not to display inline frames. ";
var s4 = "</IFRAME>";
var i=0 ;
s2 += pScrolling;
s2 += '\">';
a= "";
s1 += pFileName + s2 + s3 +s4;

//alert(s1);
// specify window parameters
TutorialWin = window.open("","photo","onLoad=window.focus(),width=850,height=650,menubar=no,status=no,scrollbars,resizable,screenX=20,screenY=40,left=80,top=20");
TutorialWin.focus();

// write content to window
  TutorialWin.document.writeln('<html><head><title>' + pTitle + '</title></head>'); 
  TutorialWin.document.writeln('<BODY BGCOLOR=White LINK=Gray VLINK=Gray> ');
  TutorialWin.document.writeln('<P STYLE="text-align: center"><font size=+2 face="arial,helvetica"><b>' + pTitle + '</b></font><br><hr></p>');
  // display iframe with pFileName inside of it
  TutorialWin.document.writeln('<P STYLE="text-align: center">'); 
  TutorialWin.document.writeln(s1);
  TutorialWin.document.writeln('<font face="arial,helvetica">');
  TutorialWin.document.writeln('<br><br>');
  TutorialWin.document.writeln(pCaption);
  TutorialWin.document.writeln('</font><br>');
  TutorialWin.document.writeln('&nbsp');
  TutorialWin.document.writeln('<font face="Arial, Helvetica" size="2" color=teal>');
  TutorialWin.document.writeln('Copyright &#169; 2005&nbsp;&nbsp;</font><font face="Arial, Helvetica" size="2" color="#993366">Powerhouse Data</font>');
  TutorialWin.document.writeln('<br><a href =" " onClick="self.close()">Close this window</a>');
  TutorialWin.document.writeln('&nbsp;<br><br></p></body></html>');
  TutorialWin.document.bgColor="lightyellow";
//for (propertyName in TutorialWin.document)
//for (propertyName in navigator)
//TutorialWin.document.writeln(propertyName + "<br>");
//TutorialWin.document.writeln("<br>navigator.appName="+navigator.appName);
//TutorialWin.document.writeln("<br>TutorialWin.document.width="+TutorialWin.document.width);
  TutorialWin.document.close(); 

}
// done hiding from old browsers -->

Then in my Text/HTML I can create a link and pass info to the new window.

<A onmouseover="window.status='Click Here';return true" title="CSS Tutorial - Second View" onclick="show_view('/tutorials/CSS_Views/MyCSS_Skin_view%282%29.htm','Powerhouse Data Tutorials',&#13;&#10;'Your view should now match the above with the light green Header.','no');return false" href="/tutorials/CSS_Views/MyCSS_Skin_view%282%29.htm">You should see the light green Header </A>

The information passed is a filename, Title, caption, and whether I want scrollbars or not.  You can view a sample of this code in action here at  http://www.powerhousedata.com/Tutorials/DNNTablelessSkinTutorialLessonOne/Page3/tabid/99/Default.aspx.  On that page there are three links each using this script - try it by clicking on "You should see the light green header"


-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/30/2005 12:50:38 AM

0/0

Thanks for the link info. What I was trying to do in the button below was to extract the user info and pass it in the url. Is there a way to open a new window like in links above except using the format I have below.Also my url is not working in passing both variables. Do you know what I might be doing wrong?

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

            Dim s As String
            Dim objUsers As New UserController
            Dim objUser As UserInfo = objUsers.GetUser(UserInfo.PortalID, UserInfo.UserID)
            '****************
            Dim StudentId As String
            Dim StudentName As String
            Dim url As String
            StudentId = objUser.Profile.IM()
            StudentName = objUser.Profile.LastName()
          
            url = "http://localhost/clublean/CourseSelection/DotNetNuke.aspx?name=" & StudentName & "studentnum=" & StudentId

            Response.Redirect(url)
           
        End Sub

DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/30/2005 7:56:48 PM

0/0

This will work:

Dim s as new System.text.StringBuilder
Dim objUsers As New UserController
Dim objUser As UserInfo = objUsers.GetUser(UserInfo.PortalID, UserInfo.UserID)
'***************
'Build your redirect string here
s.append("http://localhost/clublean/CourseSelection/DotNetNuke.aspx?name=")
s.append(objUser.LastName)
s.append("&studentnum=")
s.append(objUser.Profile.IM)

'Now redirect
Response.Redirect(s.ToString())


 

-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/30/2005 8:59:15 PM

0/0

Thanks, but how can I redirect to a new window so I do not lose my focus with DNN? I do not see how I could use the link new window code you shared earlier. Thanks again for all you insight.
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/30/2005 10:15:20 PM

0/0

Thanks for the code. Is there a way for the redirect to open in a new window? I do not see how the links new window (response above) could be integrated here in the vb code.
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/30/2005 10:29:53 PM

0/0

Thanks for the code. Is there a way for the redirect to open in a new window? I do not see how the links new window (response earlier) could be integrated here in the vb code
DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/31/2005 2:42:25 PM

0/0

To open in new window don't use response.redirect, build some JScript & use response.write (client must open a new window):

Dim s as new System.text.StringBuilder
Dim myjs As New System.text.StringBuilder
Dim objUsers As New UserController
Dim objUser As UserInfo = objUsers.GetUser(UserInfo.PortalID, UserInfo.UserID)
'***************
'Build your URL string here
s.append("http://localhost/clublean/CourseSelection/DotNetNuke.aspx?name=")
s.append(objUser.LastName)
s.append("&studentnum=")
s.append(objUser.Profile.IM)

'Now build javascript
myjs.Append("<script type = 'text/javascript'>")
myjs.Append(" window.open('" & s.ToString() & '")</script>")
Response.Write(myjs.ToString())



-doug, Powerhouse Data
DougV
Asp.Net User
Re: Passing username in a Url Of Links Module8/31/2005 2:43:50 PM

0/0

place it in your Button3_Click subroutine
-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/31/2005 8:49:03 PM

0/0

Big Smile [:D]Thank you. The your code is what I was looking for.
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module8/31/2005 9:34:50 PM

0/0

Any  ideas on how to add the following features to the new window:

"height = 200, width = 400, status = yes, toolbar = no, menubar = no, location = no"

What would the basic syntax be?

DougV
Asp.Net User
Re: Passing username in a Url Of Links Module9/1/2005 1:48:06 PM

0/0

Well that's the fun part now since you got everything working.  Just continue to add in javascript
attributes to your "myjs" string:

myjs.Append(" window.open('" & s.ToString() & "','','width=400,height=200,status,toolbar=no,menubar=no,location=no')</script>")

 


-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module9/1/2005 9:46:08 PM

0/0

Thanks for the code but when I tried it, the screen just flashed and never opened a window. Any idea where the mistake is in the code ( I copied exactly what you had)?

s.Append("http://localhost/clublean/CourseSelection/DotNetNuke.aspx?name=")

s.Append(objUser.LastName)

s.Append("&studentnum=")

s.Append(objUser.Profile.IM)

'Now build javascript

'myjs.Append("<script type = 'text/javascript'>")

'myjs.Append(" window.open('" & s.ToString() & "')</script>")

myjs.Append(" window.open('" & s.ToString() & "','','width=400,height=600,status,toolbar=no,menubar=no,location=no')</script>")

Response.Write(myjs.ToString())

DougV
Asp.Net User
Re: Passing username in a Url Of Links Module9/2/2005 2:01:07 PM

0/0

Posting to this forum broke it into two lines instead of one.
You need it all on one line (or else break it apart more)

myjs.Append(" window.open('")
myjs.Append(s.ToString())
myjs.Append("','','width=400,height=200,status,")
myjs.Append("toolbar=no,menubar=no,location=no')</script>")

It will work if you get the syntax typed in correctly.  And make sure
these '' are Apostrophes not a single double-quote.


-doug, Powerhouse Data
autolibse
Asp.Net User
Re: Passing username in a Url Of Links Module9/2/2005 10:04:55 PM

0/0

It now works, thanks. Now a new issue when the window opens I have Gridview on the form which contains a hyperlink:

<asp:HyperLinkField DataNavigateUrlFields="coursenum" HeaderText="Description" NavigateUrl="~/Descript.aspx" DataNavigateUrlFormatString="descript.aspx?coursenum={0}" Text="Description" Target="_blank" />

which opens a course description file in a new window. Is there any way to have the new window have no tool bar and menus like the window you created. Where would I put the javascript ?

19 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Programming Python Authors: Mark Lutz, Pages: 1552, Published: 2006
Higher-order Perl: A Guide to Program Transformation Authors: Mark Jason Dominus, Pages: 582, Published: 2005
Jakarta Struts Cookbook Authors: Bill Siggelkow, Pages: 507, Published: 2005
Sams Teach Yourself CGI in 24 Hours Authors: Rafe Colburn, Richard Colburn, Pages: 544, Published: 2002
Lotus Notes & Domino Essential Reference: essential reference Authors: Tim Bankes, Dave Hatter, Pages: 676, Published: 1999
Teaching Introduction to Women's Studies: Expectations and Strategies Authors: Barbara Scott Winkler, Carolyn DiPalma, Pages: 273, Published: 1999
Dreamweaver MX 2004: A Beginner's Guide Authors: Tom Muck, Ray West, Pages: 544, Published: 2004
XML in a Nutshell: A Desktop Quick Reference Authors: Elliotte Rusty Harold, W. Scott Means, Pages: 480, Published: 2001
Professional DotNetNuke 4: Open Source Web Application Framework for ASP.NET 2.0 Authors: Shaun Walker, Joe Brinkman, Bruce Hopkins, Scott McCulloch, Patrick J. Santry, Chris Paterra, Scott Willhite, Dan Caron, Pages: 517, Published: 2006
Managing Linux Systems with Webmin: System Administration and Module Development Authors: Jamie Cameron, Pages: 816, Published: 2003

Web:
Passing username in a Url Of Links Module - ASP.NET Forums Re: Passing username in a Url Of Links Module. 09-01-2005, 9:48 AM ... Smile [:) ] Re: Passing username in a Url Of Links Module. 09-02-2005, 6:04 PM ...
Pass dnn username to a link - ASP.NET Forums Pass dnn username to a link. Last post 10-08-2004 2:36 AM by DBuckner. ... Is there any way to do this without recoding the links module - or has anyone ...
Pass QueryString from Links (module) to IFrame (module). - Iframe ... Pass QueryString from Links (module) to IFrame (module). ... Meaning, that in Link module you should select URL and not Page for the target ...
Passing $view->url so that pager links are correct | drupal.org So using jquery, I call the component module to load the view, ... So how do I pass the correct url, so that component knows to build the ...
Gallery2:Modules:httpauth - Gallery Codex Get the HTTP authtype, username, and password using either the PHP server ... The URL rewrite module is needed to automatically pass the Authorization ...
Passing username via URL for login - vBadvanced Forums Is there a way to either pass the username via the URL? ... Passing username within a module as $bbuserinfo[username], theMusicMan ...
DNNSpired.com > Products > Modules > Auto Size Iframe Pass Through Variables. ratingzero.gif. Link to open Page. ratingzero.gif ... \[ username] in url will be replaced with current username. ...
Module: ActionView::Helpers::UrlHelper Passing "javascript" will dynamically create and encode the mailto: link then eval .... If you need an unescaped url, pass :escape => false in the options. ...
HTTP::WebTest::Cookbook - Recipes for typical web tests - search ... load HTTP::WebTest::Plugin::Click module which provides test # parameter ' click_link' plugins = ( ::Click ) test_name = First page url ...
Pretty please help! Cannot pass variables to new pop-up via a LINK ... Cannot pass variables to new pop-up via a LINK-URL menu item link ... How could I modify this code (οr module\mainmenu.php in general) in ...

Videos:
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...




Search This Site:










large file upload module?

problem logging in a user across a domain

complex password

questions about this image gallery

'type=' attribute in link tag renders as 'text=' when using themes

what is wrong with the setup in creater wizard membership roles

how to create a class and use it

help with permission for web hosting

user roles and page views

how to make an asp.net forums ?

difference between vb 2005 & express edition

dropdownlist - question

'practices' does not exist

authentication in a new window

site analyzer module for dnn 3.x

controlling windows service in asp.net

a namespace related problem?

how to convert julian date into calendar date (vb.net)

arrays of objects

session error handling

difference between a web application and an asp.net website?

grabbing the current user

user control

passing values to a series of dropdown lists on another page...

collapse/expand certain nodes with javascript?

clearing all fields on a web form

authentication/authorization of static html files

ebook

problem with making new user.

dnn search/indexer

 
All Times Are GMT