ASP.NET / HTML Buttons within facebox?

50 views
Skip to first unread message

unlikely

unread,
Apr 10, 2008, 9:04:29 PM4/10/08
to facebox
Is there something preventing me from having a button click event when
a button is inside a facebox?

I put a DIV with 2 textboxs and a button into a facebox. I clicked the
button and nothing happened.

Yet I click a button outside the facebox and it clicks..

so is something preventing the click event? :S

unlikely

unread,
Apr 10, 2008, 9:47:43 PM4/10/08
to facebox
Okay.. I've tried another approach.. but i'm still stuck..

I want to display a remote page like:

<a href="/facebox/remote.html" rel="facebox">text</a>

but I NEED to do it programically.. so i've got something like:

jQuery.facebox(function($) {
$.get('http://localhost/Site/frmInputBox.aspx', function(data) {
$.facebox.reveal(data, null)
})
})

And I know i'm off base here.. but I don't know what I need to do.. do
display a remote page..

thanks..
Message has been deleted
Message has been deleted

unlikely

unread,
Apr 11, 2008, 1:49:05 PM4/11/08
to facebox
Okay,

I've managed to have this run in an ASP.NET application. The user
clicks a button, which then processes some code, and then opens a
FACEBOX with an external page. Here's a procedure I made. It works
as long as you have run the "Attach It onLoad" command in the page.

Public Sub OpenInputFaceBox(ByVal aspxPage As Page, ByVal
sPageTitle As String)
Dim fullappname As String = aspxPage.Request.Url.Host
Dim MyUrl As Uri = aspxPage.Request.Url

Dim iPort As Int32 =
Convert.ToInt32(aspxPage.Request.ServerVariables("SERVER_PORT"))
Dim sWebPath As String = ""
If iPort = 80 Then
sWebPath = aspxPage.Server.HtmlEncode(MyUrl.Scheme) &
"://" & fullappname & aspxPage.Request.ApplicationPath & "/"
Else
sWebPath = aspxPage.Server.HtmlEncode(MyUrl.Scheme) &
"://" & fullappname & ":" & iPort & aspxPage.Request.ApplicationPath &
"/"
End If

Dim sScript As String = ""
sScript &= "$.facebox.loading(true);"
sScript &= "$.get('" & sWebPath & "frmInputBox.aspx" & "?PT="
& sPageTitle & "', function(data) { $.facebox.reveal(data, null) });"
RunScript(sScript, aspxPage, "blabla")
End Sub

The problem I have now is.. I have buttons on that popup page. I want
to process what the user has entered, and then close the FACEBOX. The
button IS clickable, the code gets processed.. but then running this
code FROM within that popup page:

jQuery(document).trigger('close.facebox')

doesn't close the popop. I'm guessing because it's actually a
different page. So how do I tell the page that opened it, to close
the popup?

dip...@gmail.com

unread,
May 8, 2008, 4:30:29 PM5/8/08
to facebox
facebox attaches itself to the end of BODY.
for asp.net to work you should modify it to attack to the end of FORM.
mail me if you need instructions how to do that.
Reply all
Reply to author
Forward
0 new messages