TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jessica L
NA
6
7.3k
pop up window from gridview header template
Feb 18 2011 2:20 AM
Hi experts,
i need to create a pop up window from the gridview header template, indicated below with this -
(?)
but i can't seem to place the header's ID into the page_load, how should I do to let it pop up from the header's template?
Below is the code in aspx.cs :
protected
void
Page_Load(
object
sender,
EventArgs
e)
{
OpenPopUp(
HelpLink
,
"QualityHelpRate.aspx"
,
"Help"
, 450, 650);
}
public
static
void
OpenPopUp(System.Web.UI.WebControls.
WebControl
opener,
string
PagePath)
{
string
clientScript;
//***Building the client script- window.open***//
clientScript =
"window.open(\'"
+ PagePath +
"\')"
;
//***regiter the script to the clientside click event of the 'opener' control**//
opener.Attributes.Add(
"onClick"
, clientScript);
}
public
static
void
OpenPopUp(System.Web.UI.WebControls.
WebControl
opener,
string
PagePath,
string
windowName,
int
width,
int
height)
{
string
clientScript;
string
windowAttribs;
//Building Client side window attributes with width and height.//
//Also the the window will be positioned to the middle of the screen//
windowAttribs =
"width="
+ width +
"px,"
+
"height="
+ height +
"px,"
+
"left=\'+((screen.width -"
+ width +
") / 2)+\',"
+
"top=\'+ (screen.height - "
+ height +
")/ 2+\'"
;
//***Building the client script- window.open, with additional parameters***///
clientScript =
"window.open(\'"
+ PagePath +
"\',\'"
+ windowName +
"\',\'"
+ windowAttribs +
"\');return false;"
;
//regiter the script to the clientside click event of the 'opener' control*****///
opener.Attributes.Add(
"onClick"
, clientScript);
}
Reply
Answers (
5
)
bitmap image
Image Album