Thursday, March 29, 2012
Pop Up Window..ASP.NET
I have a webform with a button.
When the user moves their mouse over the button.. I would
like to initiate a mouseover event that shows a small
window with text.. The text will be populated from a
dataset...
Does anyone here know how to do this?
I have code that does the mouseover in javascript.. A
window even pops up.. but I am not sure how to send
dynamic text to this window...
I hope I am being clear enough..
A tooltip would be ok if I could get the data to show up
in 2 lines neatly.. ie
DATAROW 1
DATAROW 2
Any ideas?
ThanksThere are a couple of possibilities.
1. Dynamically create the Window.Open() URL to include enough information to
pull from a database.
2. Feed the data into JavaScript when the page is initially called and
create a tooltip. If you cannot easily do it with HTML, consider setting up
a
layer and painting it on the mouseover event.
NOTE: The second option is more difficult to implement, as different
browsers render layers differently (some older browsers will not render at
all), so the option is more applicable to a controlled environment, like an
Intranet.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"seep" wrote:
> Hi,
> I have a webform with a button.
> When the user moves their mouse over the button.. I would
> like to initiate a mouseover event that shows a small
> window with text.. The text will be populated from a
> dataset...
> Does anyone here know how to do this?
> I have code that does the mouseover in javascript.. A
> window even pops up.. but I am not sure how to send
> dynamic text to this window...
> I hope I am being clear enough..
> A tooltip would be ok if I could get the data to show up
> in 2 lines neatly.. ie
> DATAROW 1
> DATAROW 2
> Any ideas?
> Thanks
>
Check out this article,
http://www.microsoft.com/india/msdn...endarinASP.aspx
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"seep" <seep@.hotmail.com> wrote in message
news:140501c4e775$ae32c810$a301280a@.phx.gbl...
> Hi,
> I have a webform with a button.
> When the user moves their mouse over the button.. I would
> like to initiate a mouseover event that shows a small
> window with text.. The text will be populated from a
> dataset...
> Does anyone here know how to do this?
> I have code that does the mouseover in javascript.. A
> window even pops up.. but I am not sure how to send
> dynamic text to this window...
> I hope I am being clear enough..
> A tooltip would be ok if I could get the data to show up
> in 2 lines neatly.. ie
> DATAROW 1
> DATAROW 2
> Any ideas?
> Thanks
>
Pop Up Window..ASP.NET
I have a webform with a button.
When the user moves their mouse over the button.. I would
like to initiate a mouseover event that shows a small
window with text.. The text will be populated from a
dataset...
Does anyone here know how to do this?
I have code that does the mouseover in javascript.. A
window even pops up.. but I am not sure how to send
dynamic text to this window...
I hope I am being clear enough..
A tooltip would be ok if I could get the data to show up
in 2 lines neatly.. ie
DATAROW 1
DATAROW 2
Any ideas?
ThanksThere are a couple of possibilities.
1. Dynamically create the Window.Open() URL to include enough information to
pull from a database.
2. Feed the data into JavaScript when the page is initially called and
create a tooltip. If you cannot easily do it with HTML, consider setting up a
layer and painting it on the mouseover event.
NOTE: The second option is more difficult to implement, as different
browsers render layers differently (some older browsers will not render at
all), so the option is more applicable to a controlled environment, like an
Intranet.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************
"seep" wrote:
> Hi,
> I have a webform with a button.
> When the user moves their mouse over the button.. I would
> like to initiate a mouseover event that shows a small
> window with text.. The text will be populated from a
> dataset...
> Does anyone here know how to do this?
> I have code that does the mouseover in javascript.. A
> window even pops up.. but I am not sure how to send
> dynamic text to this window...
> I hope I am being clear enough..
> A tooltip would be ok if I could get the data to show up
> in 2 lines neatly.. ie
> DATAROW 1
> DATAROW 2
> Any ideas?
> Thanks
>
Check out this article,
http://www.microsoft.com/india/msdn...endarinASP.aspx
--
-Saravana
http://dotnetjunkies.com/WebLog/saravana/
www.ExtremeExperts.com
"seep" <seep@.hotmail.com> wrote in message
news:140501c4e775$ae32c810$a301280a@.phx.gbl...
> Hi,
> I have a webform with a button.
> When the user moves their mouse over the button.. I would
> like to initiate a mouseover event that shows a small
> window with text.. The text will be populated from a
> dataset...
> Does anyone here know how to do this?
> I have code that does the mouseover in javascript.. A
> window even pops up.. but I am not sure how to send
> dynamic text to this window...
> I hope I am being clear enough..
> A tooltip would be ok if I could get the data to show up
> in 2 lines neatly.. ie
> DATAROW 1
> DATAROW 2
> Any ideas?
> Thanks
pop up windows and triggering an event after closed
I have a javascript onclick event that pops up a window,
allows the user to view information, and then close the window.
Now - I would like to be notified when this window is closed
in the asp.net page that pops it up.
Or - better yet - is there a way to popup the window in a modal mode
where the user must close the window prior to returning to the main web
application (and if at all possible - trigger an event when they are done)?
here is my current javascript for the poup window...
function upload_window()
{
var left = (screen.availWidth/2) - (600/2);
var top = (screen.availHeight/2) - (225/2);
var colorWin = window.open('upload_maps.aspx', "test", 'scrollbars=0, toolbar=0, statusbar=0, width=600, height=225, left='+left+', top='+top);
document.edit_maps_form.submit();
}
thanks for your help!!
take care
tonyThere's no way to do it server-side, but you COULD add JavaScript to do something to the window's opener when the popup window closes, i.e. window.opener.....
2) To show a modal window, use: window.showModalDialog('somepage.aspx','winName','dialogHeight:200px;dialogWidth:200px; etc..');
Remember, this only works with IE.
1) To notify the aspx page when the new window is closed, you can write Javascript:
window.opener.document.FormNameFromASPXPage.someTextBox.Text = "new win is closed";
Friday, March 16, 2012
Populating DataList control
to populate it through the page_load event.
The name of the control on the web page is "MyList".
I had code behind a button click to populate it and that
worked. Now that I've moved the code to the page_load
event it is not working. I suspect that "MyList" on the
page doesn't know about "MyList" in the page_load code
but I don't know how to connect the two. Any help would
be appreciated.
Here is the code
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim MyList As DataList
MyConnection = New SqlConnection
(" server=x2;database=Orders;Trusted_Connec
tion=yes")
MyCommand = New SqlDataAdapter("select
ReferenceNO, Loc from Request", MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Request")
MyList = New DataList
MyList.DataSource = DS.Tables
("Request").DefaultView
MyList.DataBind()
.Hi, Jerry
From your code, I guess you are dynamically generating datalist.
However, I don't see any code to add the datalist to the page.
You need to add:
Page.Controls.Add(MyList)
Bin Song, MCP
Hi Bin,
I had added the DataList control from the toolbox. My
problem was that I had failed to add the
<%# DataBinder.Eval(Container.DataItem, "ReferenceNO") %>
inside the <td> tags in the control.
Thanks,
Jerry
>--Original Message--
>Hi, Jerry
>From your code, I guess you are dynamically generating
datalist.
>However, I don't see any code to add the datalist to the
page.
>You need to add:
>Page.Controls.Add(MyList)
>Bin Song, MCP
>.
>
So your problem solved or not?
Yes. Problem solved. Thanks.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Populating DataList control
to populate it through the page_load event.
The name of the control on the web page is "MyList".
I had code behind a button click to populate it and that
worked. Now that I've moved the code to the page_load
event it is not working. I suspect that "MyList" on the
page doesn't know about "MyList" in the page_load code
but I don't know how to connect the two. Any help would
be appreciated.
Here is the code
Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim MyCommand As SqlDataAdapter
Dim MyList As DataList
MyConnection = New SqlConnection
("server=x2;database=Orders;Trusted_Connection=yes")
MyCommand = New SqlDataAdapter("select
ReferenceNO, Loc from Request", MyConnection)
DS = New DataSet
MyCommand.Fill(DS, "Request")
MyList = New DataList
MyList.DataSource = DS.Tables
("Request").DefaultView
MyList.DataBind()
..Hi Bin,
I had added the DataList control from the toolbox. My
problem was that I had failed to add the
<%# DataBinder.Eval(Container.DataItem, "ReferenceNO") %
inside the <td> tags in the control.
Thanks,
Jerry
>--Original Message--
>Hi, Jerry
>From your code, I guess you are dynamically generating
datalist.
>However, I don't see any code to add the datalist to the
page.
>You need to add:
>Page.Controls.Add(MyList)
>Bin Song, MCP
>.
So your problem solved or not?
Yes. Problem solved. Thanks.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Populating Drop Down Lists Based on Another DDL
wrapping the code that populates the first drop down in a
"IsPostBack==False" type check.
"Ben Arthur" <skchbs@dotnet.itags.org.yahoo.com> wrote in message
news:uHDS6CHAEHA.4080@dotnet.itags.org.TK2MSFTNGP09.phx.gbl...
> OK...assume the first ddl has 2 values"USA" & Australia", when i select
> USA, it populates the states correctly in the second ddl, but then if i
> select australia also, as it is autopostback, it comes back to USA as
> selected n so i cannot get the second DDL to populate to values for
> Australia...the datagrid however does bind correctly according to the
> states selected...
> Please let me know if I shoudl explain better....
> Thanks for ur time
> Ben
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!Yes ! Thanks, that worked...but i m not sure of how to handle
postbacks....i.e i load the first ddl only the first time, it loads the
USA and australia, then i select one of them, it loads second ddl
accordingly and builds the datagrid,but if i select australia, it
populates the second ddl but does not bind the grid.....though the
binding is not related to postback but to the selectedindexhanged(i shud
mention there is only value for the second ddl in my DB for first
ddl=australia)...is it related to the postback ...or is it because there
is only one value?
Thanks again for ur help.
Ben
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
My usual process for this is...
Put your grid-data-binding in a method/function/sub of its own. Call this
from the page load (wrapped in a isPostBack==False) then in each of your
drop down list events you can call the grid databind method.
BTW, do you really need a grid, they are very "heavy".
"Ben Arthur" <skchbs@.yahoo.com> wrote in message
news:u5jF9ZHAEHA.2800@.tk2msftngp13.phx.gbl...
> Yes ! Thanks, that worked...but i m not sure of how to handle
> postbacks....i.e i load the first ddl only the first time, it loads the
> USA and australia, then i select one of them, it loads second ddl
> accordingly and builds the datagrid,but if i select australia, it
> populates the second ddl but does not bind the grid.....though the
> binding is not related to postback but to the selectedindexhanged(i shud
> mention there is only value for the second ddl in my DB for first
> ddl=australia)...is it related to the postback ...or is it because there
> is only one value?
> Thanks again for ur help.
> Ben
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
thanks a lot...i had to put the binding code in postback part too n now
it works fine...
Thanks again
Ben
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!