Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Saturday, March 31, 2012

Story Ads

Hi,

We have all seen them. Those square ads inside of textual content wherethe text wraps around the ad. The ad is about halfway down the text andit floats either left, or right.

What would be the best way to do those kinds of ads? I imagine youcould take the text and count to...let's say 300 characters from theleft, insert the ad and then pick up the text starting at position 301.This seems crude and might cause problems. If the text includes htmltags, position 300 may be an opening, or closing caret, which wouldmess with the formatting.

Any ideas on how to do this in a more elegant way?

Thanks!

<img align=right src="http://pics.10026.com/?src=somepage.aspx">

This will wrap text around it, aligning it on the right and let you use "somepage.aspx" to generate the ad

Monday, March 26, 2012

strange error

My webform is working properly for an hour or so.. then suddenly it stops working. No matter what I put inside Page_Load(), Response.Redirect("hhsjdh.aspx"); for example, it doesn´t redirect or seem to care what I type.

I don´t get any errors or so, but empty tables since the mysql data is not fetched.

I have cleaned the cache and tried three different browsers. I rebuild the solution everytime I make a change in a code behind file.

I use sessions and mysql odbc driver 3.51 if that helps.Does the web server you posting to have a proxy server? Even some hardware firewalls come with proxy servers now. If so, it may have chached your page and you will need to clear the server's cache.
restart your IIS may help. type this in command line widow: iisreset /restart. It is possible that your IIS does not work properly.

Saturday, March 24, 2012

Strange Error While Debugging

I put a break point in the Page_Load function but when I tell it to run
till breakpoint, a little question mark appears inside the breakpoint
stop sign and the popup says that the breakpoint will not be hit because
there are currently no symbols loaded for this document.

What does that mean? Why isn't it hitting a line of code inside the
Page_Load function?

JohnAre you running in debug mode?

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
"John Kraft" <jhkraft@.ilstu.edu> wrote in message
news:bhbh18$d8j$1@.malachite.ilstu.edu...
> I put a break point in the Page_Load function but when I tell it to run
> till breakpoint, a little question mark appears inside the breakpoint
> stop sign and the popup says that the breakpoint will not be hit because
> there are currently no symbols loaded for this document.
> What does that mean? Why isn't it hitting a line of code inside the
> Page_Load function?
> John
hi,

1) check Project properties -> Configuration properties -> Debugging ->
enable asp.net debugging is set to on.

2) check if Buid-> configuration manager -> active configuration set to
Debug.

3) sometimes error in the code can prevent from the debugger to reach
it. remark functions to check it out.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Thursday, March 22, 2012

strange inconsistency referencing controls in Formview itemtemplate

Can anyone explain why in the following code, where btnCancel1 is a
Button inside the itemTemplate of the formview, the first call to
change the text of the button, in the Page_Load sub, works fine, but
the second call, in the bookFormView_ItemUpdated sub, throws an
exception (Object reference not set to an instance of an object)? And
if you know why, can you suggest a workaround?

Here is the code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
bookFormView.ChangeMode(FormViewMode.ReadOnly)
Dim cancelButton As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton.Text = "Cancel"
End If
End Sub

Protected Sub bookFormView_ItemUpdated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs ) Handles
bookFormView.ItemUpdated
Dim cancelButton1 As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton1.Text = "Done"
End Sub

The line of code where the error occurs is cancelButton1.Text = "Done"

Thanks in advance.

-- NedFollowup: In researching this I came across a comment that only the
controls in the current mode are accessible; if the formview is in edit
mode then only the controls in the <edititemtemplateare accessible,
if in read-only mode then only the controls in the <itemtemplateare
accessible. This might explain this except that an update is supposed
to automatically return the formview to read-only mode, right? Or does
that happen later (after the formview_itemupdated() has terminated)?
So I tried explicitly changing the mode to read-only within the
itemupdated subroutine, but I still get the same error.

Hope someone can relieve my frustration.

-- Ned

Ned Balzer wrote:

Quote:

Originally Posted by

Can anyone explain why in the following code, where btnCancel1 is a
Button inside the itemTemplate of the formview, the first call to
change the text of the button, in the Page_Load sub, works fine, but
the second call, in the bookFormView_ItemUpdated sub, throws an
exception (Object reference not set to an instance of an object)? And
if you know why, can you suggest a workaround?
>
Here is the code:
>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
bookFormView.ChangeMode(FormViewMode.ReadOnly)
Dim cancelButton As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton.Text = "Cancel"
End If
End Sub
>
Protected Sub bookFormView_ItemUpdated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs ) Handles
bookFormView.ItemUpdated
Dim cancelButton1 As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton1.Text = "Done"
End Sub
>
>
>
The line of code where the error occurs is cancelButton1.Text = "Done"
>
Thanks in advance.
>
-- Ned


1) Why not just use the control's variable? If the control has an id of
btnCancel1 and it's marked runat="server", then just do btnCancel1.Text =
"Done"

2) Are you using master pages? Control ID's change when placed into a
content placeholder on a master page. Use the DevToolBar to explore the DOM
and determine what your control's ID actually is on the client size.

"Ned Balzer" wrote:

Quote:

Originally Posted by

Can anyone explain why in the following code, where btnCancel1 is a
Button inside the itemTemplate of the formview, the first call to
change the text of the button, in the Page_Load sub, works fine, but
the second call, in the bookFormView_ItemUpdated sub, throws an
exception (Object reference not set to an instance of an object)? And
if you know why, can you suggest a workaround?
>
Here is the code:
>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
bookFormView.ChangeMode(FormViewMode.ReadOnly)
Dim cancelButton As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton.Text = "Cancel"
End If
End Sub
>
Protected Sub bookFormView_ItemUpdated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs ) Handles
bookFormView.ItemUpdated
Dim cancelButton1 As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton1.Text = "Done"
End Sub
>
>
>
The line of code where the error occurs is cancelButton1.Text = "Done"
>
Thanks in advance.
>
-- Ned
>
>


1) When I try that, I get an error in Visual Web Developer 2005: "Name
'btnCancel1' is not declared." It is marked runat="server" but I think
the problem arises because it is buried within the formview, so it's
not a normal button control.

2) No, I am not currently using master pages.

-- Ned

William Sullivan wrote:

Quote:

Originally Posted by

1) Why not just use the control's variable? If the control has an id of
btnCancel1 and it's marked runat="server", then just do btnCancel1.Text =
"Done"
>
2) Are you using master pages? Control ID's change when placed into a
content placeholder on a master page. Use the DevToolBar to explore the DOM
and determine what your control's ID actually is on the client size.
>
"Ned Balzer" wrote:
>

Quote:

Originally Posted by

Can anyone explain why in the following code, where btnCancel1 is a
Button inside the itemTemplate of the formview, the first call to
change the text of the button, in the Page_Load sub, works fine, but
the second call, in the bookFormView_ItemUpdated sub, throws an
exception (Object reference not set to an instance of an object)? And
if you know why, can you suggest a workaround?

Here is the code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
bookFormView.ChangeMode(FormViewMode.ReadOnly)
Dim cancelButton As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton.Text = "Cancel"
End If
End Sub

Protected Sub bookFormView_ItemUpdated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs ) Handles
bookFormView.ItemUpdated
Dim cancelButton1 As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton1.Text = "Done"
End Sub

The line of code where the error occurs is cancelButton1.Text = "Done"

Thanks in advance.

-- Ned


Well, it doesn't make sense to me, but I found the suggestion somewhere
and tried it: calling bookformview.databind() before attempting to
reference the object, and the error went away. Problem is, the button
text is not being changed either.

Hmmmmmm

Ned Balzer wrote:

Quote:

Originally Posted by

1) When I try that, I get an error in Visual Web Developer 2005: "Name
'btnCancel1' is not declared." It is marked runat="server" but I think
the problem arises because it is buried within the formview, so it's
not a normal button control.
>
2) No, I am not currently using master pages.
>
-- Ned
>
William Sullivan wrote:

Quote:

Originally Posted by

1) Why not just use the control's variable? If the control has an id of
btnCancel1 and it's marked runat="server", then just do btnCancel1.Text =
"Done"

2) Are you using master pages? Control ID's change when placed into a
content placeholder on a master page. Use the DevToolBar to explore the DOM
and determine what your control's ID actually is on the client size.

"Ned Balzer" wrote:

Quote:

Originally Posted by

Can anyone explain why in the following code, where btnCancel1 is a
Button inside the itemTemplate of the formview, the first call to
change the text of the button, in the Page_Load sub, works fine, but
the second call, in the bookFormView_ItemUpdated sub, throws an
exception (Object reference not set to an instance of an object)? And
if you know why, can you suggest a workaround?
>
Here is the code:
>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
bookFormView.ChangeMode(FormViewMode.ReadOnly)
Dim cancelButton As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton.Text = "Cancel"
End If
End Sub
>
Protected Sub bookFormView_ItemUpdated(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs ) Handles
bookFormView.ItemUpdated
Dim cancelButton1 As Button =
CType(bookFormView.FindControl("btnCancel1"), Button)
cancelButton1.Text = "Done"
End Sub
>
>
>
The line of code where the error occurs is cancelButton1.Text = "Done"
>
Thanks in advance.
>
-- Ned
>
>

Tuesday, March 13, 2012

strange problem about ModalPopupExtender

Hi guys
i have a strange problem about my modalpopupextender. In my page, i put a
gridview inside a updatepanel with paging enabled. also i put a
modalpopupextender in another updatepanel to do the edit and add new job.
My problem is everytime time i change the page index in my gridview. and i
click my add new button the validator in the modalpopupextender will show
the error message. but after i click the cancel button to close the
modalpopupextender then open it again. the error message will disappear. and
everything displays fine.
Can anyone tell me how this happen'..
cheers
VictorHi Victor,
First, please note this ModalPopupExtender is part of ASP.NET AJAX Control
Toolkit.
The control toolkit is a shared-source collaborative project built together
by a team containing both Microsoft and non-Microsoft developers (visit the
CodePlex Project to learn more, or volunteer to contribute). All source
for the controls is provided completely for free (with full re-use and
modification rights).
The majority of controls within the ASP.NET AJAX Control Toolkit leverage
the "Control Extender" pattern that the core ASP.NET AJAX library
introduces, and which delivers a super powerful way to easily enable
specific AJAX scenarios on a site with minimal effort.
Please download the sample website along with the control toolkit, there's
an example webform for the ModalPopupExtender. My understanding is that you
don't need to put the control inside a UpdatePanel.
Besides that, I'm also still not quite clear about the issue you described,
would you please depict more? Thanks.
Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.

strange problem about ModalPopupExtender

Hi guys
i have a strange problem about my modalpopupextender. In my page, i put a
gridview inside a updatepanel with paging enabled. also i put a
modalpopupextender in another updatepanel to do the edit and add new job.
My problem is everytime time i change the page index in my gridview. and i
click my add new button the validator in the modalpopupextender will show
the error message. but after i click the cancel button to close the
modalpopupextender then open it again. the error message will disappear. and
everything displays fine.

Can anyone tell me how this happen??..

cheers
VictorHi Victor,

First, please note this ModalPopupExtender is part of ASP.NET AJAX Control
Toolkit.

The control toolkit is a shared-source collaborative project built together
by a team containing both Microsoft and non-Microsoft developers (visit the
CodePlex Project to learn more, or volunteer to contribute). All source
for the controls is provided completely for free (with full re-use and
modification rights).

The majority of controls within the ASP.NET AJAX Control Toolkit leverage
the "Control Extender" pattern that the core ASP.NET AJAX library
introduces, and which delivers a super powerful way to easily enable
specific AJAX scenarios on a site with minimal effort.

Please download the sample website along with the control toolkit, there's
an example webform for the ModalPopupExtender. My understanding is that you
don't need to put the control inside a UpdatePanel.

Besides that, I'm also still not quite clear about the issue you described,
would you please depict more? Thanks.

Regards,
Walter Wang (wawang@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.