Thursday, March 29, 2012
Pop Up windows
What is the best approach to bringing up pop-up windows to verify a users
request. (i.e. - "Are you sure you want to delete? yes no)
I know how to bring the window up in javascript...but once the user click
"yes" in the new pop-up window, I need to somehow invoke a delete call in
the c# code behind of the original page.
Any help would be appreciated.
Thanks.Using either a Button or LinkButton control, you can add the "onclick"
attribute to it and place the javascript code in there.
For example:
lnkCancel.Attributes.Add("onclick", "return window.confirm('Are you sure
you want to cancel this order?');");
If the user clicks OK, the button will submit and the appropriate
code-behind for the button will be executed. If the user clicks cancel,
then the form will not submit.
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
"Bilbo" <Bilbo@.cox.net> wrote in message
news:OcSpUe6iEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Hello,
> What is the best approach to bringing up pop-up windows to verify a users
> request. (i.e. - "Are you sure you want to delete? yes no)
> I know how to bring the window up in javascript...but once the user click
> "yes" in the new pop-up window, I need to somehow invoke a delete call in
> the c# code behind of the original page.
> Any help would be appreciated.
> Thanks.
>
Pop Up windows
What is the best approach to bringing up pop-up windows to verify a users
request. (i.e. - "Are you sure you want to delete? yes no)
I know how to bring the window up in javascript...but once the user click
"yes" in the new pop-up window, I need to somehow invoke a delete call in
the c# code behind of the original page.
Any help would be appreciated.
Thanks.Using either a Button or LinkButton control, you can add the "onclick"
attribute to it and place the javascript code in there.
For example:
lnkCancel.Attributes.Add("onclick", "return window.confirm('Are you sure
you want to cancel this order?');");
If the user clicks OK, the button will submit and the appropriate
code-behind for the button will be executed. If the user clicks cancel,
then the form will not submit.
--
Ben Lucas
Lead Developer
Solien Technology, Inc.
www.solien.com
"Bilbo" <Bilbo@.cox.net> wrote in message
news:OcSpUe6iEHA.3876@.TK2MSFTNGP15.phx.gbl...
> Hello,
> What is the best approach to bringing up pop-up windows to verify a users
> request. (i.e. - "Are you sure you want to delete? yes no)
> I know how to bring the window up in javascript...but once the user click
> "yes" in the new pop-up window, I need to somehow invoke a delete call in
> the c# code behind of the original page.
> Any help would be appreciated.
> Thanks.
Pop up windows
How to make pop up window from code behine without using
java script. And another thing is that, how to pass value
from the pop up window to a form if there is a textbox in
the pop up. ThanksMaking popup windows is a client task and as such it can be done only with
client tools. The only way to create a popup is javascript showModalDialog
call.
You can pass a value back from popup in window.returnValue property. The
javascript showModalDialog statement that started the popup will get this
value as a result of the call.
Eliyahu
"Souljaz" <Souljaz@.discussions.microsoft.com> wrote in message
news:1ddd01c52de9$9e89fb80$a401280a@.phx.gbl...
> Hi,
> How to make pop up window from code behine without using
> java script. And another thing is that, how to pass value
> from the pop up window to a form if there is a textbox in
> the pop up. 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";
Pop up windows
How to make pop up window from code behine without using
java script. And another thing is that, how to pass value
from the pop up window to a form if there is a textbox in
the pop up. ThanksMaking popup windows is a client task and as such it can be done only with
client tools. The only way to create a popup is javascript showModalDialog
call.
You can pass a value back from popup in window.returnValue property. The
javascript showModalDialog statement that started the popup will get this
value as a result of the call.
Eliyahu
"Souljaz" <Souljaz@.discussions.microsoft.com> wrote in message
news:1ddd01c52de9$9e89fb80$a401280a@.phx.gbl...
> Hi,
> How to make pop up window from code behine without using
> java script. And another thing is that, how to pass value
> from the pop up window to a form if there is a textbox in
> the pop up. Thanks
pop up windows
I have programmed in Java and Windows form but very new to ASP and web in general. It is very primitive question but currently, I do not know. I want a small pop up windows with close or the like button that will appear when I click on a button. In Java or NET, you can use show method but in ASP or Webmatrix in particular, what component should I use .
Regards.Hello, check my BLOG, I have an article on how to pop up a window from inside ASP.NET
regards
I'm sure haidar's blog shows the proper method - but to help clear up for future knowledge..
Popping up a web page is a client-side event. The .Net server can't feed a popup to your browser- think of all the uncontrollable popups that would occur if the server-side could do this. opening a popup is a clients-ide event using javascript (window.open method)
Hope that helps - and it's a common question - understanding what events are client-side and what are server-side will help avoid confusion
Of course the contents of the popup can be totally designed (perhaps as a web user control) on the server side from within .NET and then merely instanciated in the javascipt. This gives full access to all of the .NET design environment features for the pop-up.
ps: I have not read the blog entry, so that *may* how it is done there also...
Hi!
I use Javascript but as very primitive programmer, I just am able to have this code:
<a onclick="window.open('materialchecking.aspx textbox=txtStartDate','cal','width=250,height=225,left=270,top=180')" href="http://links.10026.com/?link=javascript:;">
<input type="button" value="Check" /></a
It works fine as static page. However, what if I want to transfer some variable value from main page to the pop up windows to do the checking or other way around, do ing some data processing when button is clicked and transfer the result in to the pop up. I guess, there should be other approach as the href is perhaps too simple to do that.
Regards.
Hello, please check my BLOG below, I have an article on how to pop up windows inside asp.net
regards
Sorry!
I did not go to Pop up before and just went to your personal website and could not see the article (!1).
OK. But now question is that I want to transfer some data between master page and pop up windows. How is it possible. Suppose pop up windows is to show the number of stock in record and in store is not different. So when button is clicked, I have top go to server-side database to do something and finally transfer thw TWO number to the pop up. So how to do that.
Thank you so much for your attention.
ok, you might use the Querystring to pass values to the child window
regards
Hi!
I would really appreaciate if you can show me a bit of code to pass A VALUE to child windows.
Regards.
using function in blog...
*************************************
Javascript pop up window script
*************************************
<SCRIPT TYPE="text/javascript">
<!--
function popupform(myform, url, windowname)
{
// don't allow if we don't have the focus
if (! window.focus)return true;// open the new window,
window.open(url, windowname, 'width=250,height=225,left=270,top=180,scrollbars=yes');
myform.target=windowname;
return true;
}
//-->
</SCRIPT>
then in your link...
<a onclick="popupform(this,'materialchecking.aspx?id='+ document.getElementById('textbox1').value,'cal')" href="http://links.10026.com/?link=javascript:"><input type="button" value="Check" /></a>
</body>
<input type="button" value="Check" /></a>
one of many ways probably .......
HTH
Hi!
Please forgive me if I apprea to be a bit dump. I am quite new to the field. As far as I understand, the call: document.getElementById is to set the value of textbox 1 to cal var. So in the pop up page, which command I should use to EXTRACT that value for use.
In MSDN page, i says that we can pass a colection of value. That is fine, Juts search var by id inb Collection. But I mean what command to EXTRACT those value in the page after we pass that value in the open up command.
To help make it clear, suppose I have an page asking for the invoice number. As within an invoice, there can be many materials with different quantity and price so I decide that after use enter the Supplier and Invoice number, user will be presented with Pop up windows that has text box and dropdownlist to enter list of data. But in this Pop up windows , the Supplier name and invoice name shold be present. I am looking for way to show the Suplier name and Invoice number on the Pop up windows.
Thank you very much for your attention.
in the example - the id of the invoice is being passed using "querystring"
if you look up at the address of this forum page- you will see "?tabindex=1&PostID=782635&mode=flat"
or something like that - this is called the querystring. It is passed as part of the url the client is requesting. In this example there are 3 things being passed - tabindex,postid, and mode
On the page being called- you can access theses values by using
dim myPostID as string
dim myTabIndex as string
dim myMode as string
myPostID = request.querystring("tabindex")
myTabIndex = request.querystring("PostID")
myMode = request.querystring("mode")
then i can use this any way i need to such as..
Sub Page_Load()
dim mySQL as string="Select * from posts WHERE PostId=" & MyPostID
....................
not exact code - but you get the idea
if on the first page, you already hace the supplier and invoice number - then you can pass that in the querystring as such
a onclick="popupform(this,'materialchecking.aspx?Supplier='+ document.getElementById('textbox1').value+ "&Invoice=" + document.getElementById('textbox2').value,'mypopupwindow_name')"
on the recieving page materialchecking.aspx - you would use
Sub Page_Load()
dim MySupplier as string = request.querystrin("Supplier")
dim MyInvoice as string = request.querystrin("Invoice")
HTH
Thank you uncleb1
They all work now. Apart from "&Invoice=" I have to change to '&Invoice' (!!!!cheer), all work and I learn a lot from this doing. Thank you
Hi again!
Now there is more challenge. Suppose I have an textbox that must be filled. I use RequiredValidator. Problem is that with "normal" button, I can write the code for validator but I do not know how for the ´button, created with javascript. Basically, the Pop up windows only works if textbox is not empty.
if you used this function
<SCRIPT TYPE="text/javascript">
<!--
function popupform(myform, url, windowname)
{
// don't allow if we don't have the focusif (! window.focus)return true;
// open the new window,
window.open(url, windowname, 'width=250,height=225,left=270,top=180,scrollbars=yes');
myform.target=windowname;
return true;
}
//-->
</script>
......... you have a place to check for null<SCRIPT TYPE="text/javascript">
<!--
function popupform(myform, url, windowname)
{// don't allow if textbox is blank
if documet.getElementById(textbox1).value="" return true;// don't allow if we don't have the focus
if (! window.focus)return true;
// open the new window,
window.open(url, windowname, 'width=250,height=225,left=270,top=180,scrollbars=yes');
myform.target=windowname;
return true;
}
//-->
</script>
or you could use a serverside asp textbox and use the built in asp validation - check out this tutorial
http://www.dotnetjunkies.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/doc/webvalidation.aspx
HTH
Pop Up without TitleBars?
I have been trying to customize pop up windows for my ASP.NET Page. I want
to have a custom title bar. Is there a way to remove the windows title bar
from the pop up and make it apear as a frameless window?
Also I am using Windows XP with SP1.
If you know a way out, please help me!
Regards
Jyoti> Hello All!
> I have been trying to customize pop up windows for my ASP.NET Page. I want
to
> have a custom title bar. Is there a way to remove the windows title bar fr
om
> the pop up and make it apear as a frameless window?
> Also I am using Windows XP with SP1.
> If you know a way out, please help me!
> Regards
> Jyoti
I don't think that is possible, mainly for security reasons.
The fact that *you* are using a particular platform is not important
here, you will need to know what your *visitors* are using.
Hans Kesting
Thanks for replying Hans!
The point is that my application should work for the visitors using Windows
XP! And its not working there! Well, I am still trying to find a way out.
Thanks for your help!
Regards Jyoti
"Hans Kesting" <news.1.hansdk@.spamgourmet.com> wrote in message
news:mn.724c7d5b866fd633.41829@.spamgourmet.com...
> I don't think that is possible, mainly for security reasons.
> The fact that *you* are using a particular platform is not important here,
> you will need to know what your *visitors* are using.
> Hans Kesting
>
Pop Up without TitleBars?
I have been trying to customize pop up windows for my ASP.NET Page. I want
to have a custom title bar. Is there a way to remove the windows title bar
from the pop up and make it apear as a frameless window?
Also I am using Windows XP with SP1.
If you know a way out, please help me!
Regards
Jyoti> Hello All!
> I have been trying to customize pop up windows for my ASP.NET Page. I want to
> have a custom title bar. Is there a way to remove the windows title bar from
> the pop up and make it apear as a frameless window?
> Also I am using Windows XP with SP1.
> If you know a way out, please help me!
> Regards
> Jyoti
I don't think that is possible, mainly for security reasons.
The fact that *you* are using a particular platform is not important
here, you will need to know what your *visitors* are using.
Hans Kesting
Thanks for replying Hans!
The point is that my application should work for the visitors using Windows
XP! And its not working there! Well, I am still trying to find a way out.
Thanks for your help!
Regards Jyoti
"Hans Kesting" <news.1.hansdk@.spamgourmet.com> wrote in message
news:mn.724c7d5b866fd633.41829@.spamgourmet.com...
>> Hello All!
>>
>> I have been trying to customize pop up windows for my ASP.NET Page. I
>> want to have a custom title bar. Is there a way to remove the windows
>> title bar from the pop up and make it apear as a frameless window?
>>
>> Also I am using Windows XP with SP1.
>> If you know a way out, please help me!
>>
>> Regards
>> Jyoti
> I don't think that is possible, mainly for security reasons.
> The fact that *you* are using a particular platform is not important here,
> you will need to know what your *visitors* are using.
> Hans Kesting
pop up windows with img and text from...?
I'm trying to create a portfolio page, the pages would be divided into years from 2001 ~ 2004 with each page a link of projects that my company has done. when the link is clicked it would open a new window with both image and text.
my question is how should i build this pop up page, with over 90 images i do not want to create individual aspx pop up windows, so if i was to get img and text info where should it be coming from? would sql server or is there was a to put this info in the project page? I haven't a clue, plz help.
ps. if you can point me to an example on the net that would be great..
focusA good place to start may be the following tutorial:
A Robust Image Gallery for ASP.NET
wow thanks NewKid2~
i'm still reading it but its a great example, not only for my project but for my personal use as well, also i love the fact that its in vb.net there should be a page called top 10 everyday examples in vb.net for the noobie in you!
focus
> there should be a page called top 10 everyday examples in vb.net
Well, the same guys have written a bunch of ASP.NET articles, most of them using VB.NET, and all written in an easy-to-understand way.
You can see the entire list of their articles here:
http://aspnet.4guysfromrolla.com
pop ups
uses JavaScript to open new browser windows and they are being shut down
automatically...Pop up blockers don't block windows that are opened by the same domain as
the page that is loaded.
"mareal" <m@.m.com> wrote in message
news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> Is there any way to programmatically open pop ups with SP2? My ASP.NET
> site
> uses JavaScript to open new browser windows and they are being shut down
> automatically...
Thank you Scott. I am not sure I am following. My browser even blocks
Microsoft pop ups from this forum unless I allow them.
I was hoping to find some kind of command to allow my site to open new
browser windows (overwriting pop ups directives)
"Scott M." wrote:
> Pop up blockers don't block windows that are opened by the same domain as
> the page that is loaded.
> "mareal" <m@.m.com> wrote in message
> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> > Is there any way to programmatically open pop ups with SP2? My ASP.NET
> > site
> > uses JavaScript to open new browser windows and they are being shut down
> > automatically...
>
The pop ups you get from various web sites (including MS) don't actually
have content that comes from the domain you are visiting. Most companies
have special servers dedicated to just serving up the advertising content
(ad servers). For example, the content of a popup ad that you got while
visiting cnn.com might actually be coming from http://ads.cnn.com and the
content of the popup windows you get while visiting Microsoft's web site
might actually be coming from http://ads.microsoft.com.
When you build a web page that includes the window.open() client-side
scripting command that doesn't mean that a popup blocker will prevent that
window from opening. Most popup blockers look to see where the content of
that new window is coming from. If it is from the same domain as the page
that launched it, the popup will be allowed, if not it won't.
For example, visit this page that I built and run for my son's cub scout
pack (http://pack96.org/Calendar/PackCalendar.aspx) and click on one of the
links. You will see that the popup windows do not get blocked even though
your popup blocker is on.
-Scott
"mareal" <m@.m.com> wrote in message
news:DD978129-4376-435E-8F35-C4F80209AD1F@.microsoft.com...
> Thank you Scott. I am not sure I am following. My browser even blocks
> Microsoft pop ups from this forum unless I allow them.
> I was hoping to find some kind of command to allow my site to open new
> browser windows (overwriting pop ups directives)
> "Scott M." wrote:
>> Pop up blockers don't block windows that are opened by the same domain as
>> the page that is loaded.
>>
>> "mareal" <m@.m.com> wrote in message
>> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
>> > Is there any way to programmatically open pop ups with SP2? My ASP.NET
>> > site
>> > uses JavaScript to open new browser windows and they are being shut
>> > down
>> > automatically...
>>
>>
>
pop ups not working
Hi
i am working on a project which involves pop up windows to enter information which worked fine at uni
i brought the exact same project home and the popups dont 'popup, nothing happens
i've allowed popups in internet explorer, but they still dont work
is there something else i've overlooked??
cheers!!
hehe
sorry for wasting space
just remembered i took a line of code out just before i left uni yesterday that stopped popups working
blah!!
pop ups
uses JavaScript to open new browser windows and they are being shut down
automatically...Pop up blockers don't block windows that are opened by the same domain as
the page that is loaded.
"mareal" <m@.m.com> wrote in message
news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> Is there any way to programmatically open pop ups with SP2? My ASP.NET
> site
> uses JavaScript to open new browser windows and they are being shut down
> automatically...
Thank you Scott. I am not sure I am following. My browser even blocks
Microsoft pop ups from this forum unless I allow them.
I was hoping to find some kind of command to allow my site to open new
browser windows (overwriting pop ups directives)
"Scott M." wrote:
> Pop up blockers don't block windows that are opened by the same domain as
> the page that is loaded.
> "mareal" <m@.m.com> wrote in message
> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
>
>
The pop ups you get from various web sites (including MS) don't actually
have content that comes from the domain you are visiting. Most companies
have special servers dedicated to just serving up the advertising content
(ad servers). For example, the content of a popup ad that you got while
visiting cnn.com might actually be coming from http://ads.cnn.com and the
content of the popup windows you get while visiting Microsoft's web site
might actually be coming from http://ads.microsoft.com.
When you build a web page that includes the window.open() client-side
scripting command that doesn't mean that a popup blocker will prevent that
window from opening. Most popup blockers look to see where the content of
that new window is coming from. If it is from the same domain as the page
that launched it, the popup will be allowed, if not it won't.
For example, visit this page that I built and run for my son's cub scout
pack (http://pack96.org/Calendar/PackCalendar.aspx) and click on one of the
links. You will see that the popup windows do not get blocked even though
your popup blocker is on.
-Scott
"mareal" <m@.m.com> wrote in message
news:DD978129-4376-435E-8F35-C4F80209AD1F@.microsoft.com...
> Thank you Scott. I am not sure I am following. My browser even blocks
> Microsoft pop ups from this forum unless I allow them.
> I was hoping to find some kind of command to allow my site to open new
> browser windows (overwriting pop ups directives)
> "Scott M." wrote:
>
Wednesday, March 21, 2012
populating & Submitting an external form
In windows forms this can be done using the microsoft web browser control, but how is it done in asp.net either using the axwebbrowser control or httpwebrequest methods
this is an example description only actul sites and stuff will be different
I want my web site to do a search on google so on my site the user enters the input value into a text box, and they press send data.
This is then passed to google via some kind of magic, (ie webrequest) and we populate the google input box and press the search button, when we get our results back from google, i run the response via my regular expression and display the results in my own format.
I dont actully want to spider googles results its just the method is the closest description i can give to what i want to do.
I have been looking at posting data with the httpwebrequest and response methods but im not sure on it.
Can someone advise of the best possible method to handle such events
regards
Carlbump
Try the Google Web Services, even the free subscription allows you loads of searches.
You just make your own pages but use Google to do the searches, very straightforward.
i did say that i only was using google as an example
Populating a Dataset
Please tell me what I'm doing wrong.
check that if the dataset is populated when there is no PostBack.
Public Overloads Function GetBookInfo() As DataSet
Dim oPubConnection As SqlConnection
Dim SConnString As String
Dim osqlCommPubs As SqlCommand
Dim osqlCommTitles As SqlCommand
Dim oDataAdapterPubs As SqlDataAdapter
Dim oDataAdapterTitles As SqlDataAdapterTry
SConnString = "Data Source=(local);Initial Catalog=Pubs;" & _
"User ID=sa;Password=;"
oPubConnection = New SqlConnection(SConnString)
oPubConnection.Open()'Create command to retrieve pub info
osqlCommPubs = New SqlCommand
osqlCommPubs.Connection = oPubConnection
osqlCommPubs.CommandText = "Select Pub_ID, Pub_Name from Publishers"'Create Data Adapter for pub info
oDataAdapterPubs = New SqlDataAdapter
oDataAdapterPubs.SelectCommand = osqlCommPubs'Create command to retrieve title info
osqlCommTitles = New SqlCommand
osqlCommTitles.Connection = oPubConnection
osqlCommPubs.CommandText = "select Pub_ID, title, price, ytd_sales from titles"'Create data adapter for title info
oDataAdapterTitles = New SqlDataAdapter
oDataAdapterTitles.SelectCommand = osqlCommTitles'Create and fill a data set
Dim datBookInfo As DataSet = New DataSet
oDataAdapterPubs.Fill(datBookInfo, "Publishers")
oDataAdapterTitles.Fill(datBookInfo, "Titles")
Return datBookInfoCatch ex As Exception
Finally
oPubConnection.Close()End Try
End Function
If(!Page.IsPostBack)
{
LoadData();
}
Hmm, dont see anything obvious...How are you doing your bind of the dataset to the grid?
Also, since this is a windows project and not a web project (assuming your "I've created a vb windows application" is correct) there will NOT be a page.isPostBack...
Thanks,
MajorCats