Showing posts with label directly. Show all posts
Showing posts with label directly. Show all posts

Monday, March 26, 2012

HTML Files from IE

Hi:
Why i cannot see the content of a HTML file, when i open it directly from
IE, it shows "canceled action"Hi Laurahn,
What HTML file is it? Does it it contain script? By default, IE will block
script executing if the file is opened locally.
Please post the html file or some of its code here so that we can help
further. Thanks.
By the way, not sure if it applies but if you're using <script> block in
the html file, remember IE doesn't support <script />, you must use
<script></script>.
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.
Hi Laurahn,
If you see this, would you please reply here to let me know the status of
this post? 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.

HTML Files from IE

Hi:
Why i cannot see the content of a HTML file, when i open it directly from
IE, it shows "canceled action"Hi Laurahn,

What HTML file is it? Does it it contain script? By default, IE will block
script executing if the file is opened locally.

Please post the html file or some of its code here so that we can help
further. Thanks.

By the way, not sure if it applies but if you're using <scriptblock in
the html file, remember IE doesn't support <script />, you must use
<script></script>.

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.
Hi Laurahn,

If you see this, would you please reply here to let me know the status of
this post? 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.

Thursday, March 22, 2012

HTML Controls and User controls

I have a user control that is basically a login dialogue.
If I add the user control to webpage1, can I access the
properties directly from C# codebehind, or do I have to
access the properties from HTML behind webpage1.

Thanks in advance. PeteWebpage1 is a standard ASP.NET webform which contains the
user control. I know I can access properties of the user
control via the HTML of webpage1 i.e.
<uc1:LoginUserControl id="LoginUserControl1"
property1="Hello" property2="Goodbye"
runat="server"></uc1:LoginUserControl
but is it possible to access the properties from webpage1
code behind page.

Hope this is a little clearer.
Pete.

>--Original Message--
>What exactly is "webpage1?"
>HTH,
>Kevin Spencer
>Microsoft FrontPage MVP
>Internet Developer
>http://www.takempis.com
>Big things are made up of
>lots of Little things.
>"trinitypete" <support@.trinity.com> wrote in message
>news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
>> I have a user control that is basically a login
dialogue.
>> If I add the user control to webpage1, can I access the
>> properties directly from C# codebehind, or do I have to
>> access the properties from HTML behind webpage1.
>>
>> Thanks in advance. Pete
>
>.
Yes It is possible. Here is the code to do it.

Dim _myControl As Control = Page.FindControl("UserControlName")
Dim _myControlType As Type = _myControl.GetType()
Dim _myControl_Property As PropertyInfo =
_myControlType.GetProperty("PROPERTYNAME")

sTemp = _myControl_Property.GetValue(_myControl, Nothing)

Hope this helps.

Ryan

"trinitypete" <support@.trinity.com> wrote in message
news:0c6201c33b29$2351b0c0$a401280a@.phx.gbl...
> Webpage1 is a standard ASP.NET webform which contains the
> user control. I know I can access properties of the user
> control via the HTML of webpage1 i.e.
> <uc1:LoginUserControl id="LoginUserControl1"
> property1="Hello" property2="Goodbye"
> runat="server"></uc1:LoginUserControl>
> but is it possible to access the properties from webpage1
> code behind page.
> Hope this is a little clearer.
> Pete.
> >--Original Message--
> >What exactly is "webpage1?"
> >HTH,
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >http://www.takempis.com
> >Big things are made up of
> >lots of Little things.
> >"trinitypete" <support@.trinity.com> wrote in message
> >news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
> >> I have a user control that is basically a login
> dialogue.
> >> If I add the user control to webpage1, can I access the
> >> properties directly from C# codebehind, or do I have to
> >> access the properties from HTML behind webpage1.
> >>
> >> Thanks in advance. Pete
> >.
It worked a treat - Thanks.

>--Original Message--
>Yes It is possible. Here is the code to do it.
> Dim _myControl As Control = Page.FindControl
("UserControlName")
> Dim _myControlType As Type =
_myControl.GetType()
> Dim _myControl_Property As PropertyInfo =
>_myControlType.GetProperty("PROPERTYNAME")
> sTemp = _myControl_Property.GetValue
(_myControl, Nothing)
>
>Hope this helps.
>Ryan
>
>"trinitypete" <support@.trinity.com> wrote in message
>news:0c6201c33b29$2351b0c0$a401280a@.phx.gbl...
>> Webpage1 is a standard ASP.NET webform which contains
the
>> user control. I know I can access properties of the user
>> control via the HTML of webpage1 i.e.
>> <uc1:LoginUserControl id="LoginUserControl1"
>> property1="Hello" property2="Goodbye"
>> runat="server"></uc1:LoginUserControl>
>>
>> but is it possible to access the properties from
webpage1
>> code behind page.
>>
>> Hope this is a little clearer.
>> Pete.
>>
>> >--Original Message--
>> >What exactly is "webpage1?"
>>> >HTH,
>>> >Kevin Spencer
>> >Microsoft FrontPage MVP
>> >Internet Developer
>> >http://www.takempis.com
>> >Big things are made up of
>> >lots of Little things.
>>> >"trinitypete" <support@.trinity.com> wrote in message
>> >news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
>> >> I have a user control that is basically a login
>> dialogue.
>> >> If I add the user control to webpage1, can I access
the
>> >> properties directly from C# codebehind, or do I have
to
>> >> access the properties from HTML behind webpage1.
>> >>
>> >> Thanks in advance. Pete
>>>> >.
>>
>.
Your CodeBehind Page should have a reference to the control if you used the
tag you mentioned in your reply. You can therefore access the properties of
the object in your CodeBehind (using its' ID) without any problem.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"trinitypete" <support@.trinity.com> wrote in message
news:0c6201c33b29$2351b0c0$a401280a@.phx.gbl...
> Webpage1 is a standard ASP.NET webform which contains the
> user control. I know I can access properties of the user
> control via the HTML of webpage1 i.e.
> <uc1:LoginUserControl id="LoginUserControl1"
> property1="Hello" property2="Goodbye"
> runat="server"></uc1:LoginUserControl>
> but is it possible to access the properties from webpage1
> code behind page.
> Hope this is a little clearer.
> Pete.
> >--Original Message--
> >What exactly is "webpage1?"
> >HTH,
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >http://www.takempis.com
> >Big things are made up of
> >lots of Little things.
> >"trinitypete" <support@.trinity.com> wrote in message
> >news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
> >> I have a user control that is basically a login
> dialogue.
> >> If I add the user control to webpage1, can I access the
> >> properties directly from C# codebehind, or do I have to
> >> access the properties from HTML behind webpage1.
> >>
> >> Thanks in advance. Pete
> >.
Sorry trinitypete,

I misunderstood your question, and neglected to observe that you were
talking about a User Control instead of a Server Control. Handling the User
Control from your CodeBehind is a bit trickier than a Server Control. The
following MSDN article should help:

http://msdn.microsoft.com/library/d...tproperties.asp

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.

"trinitypete" <support@.trinity.com> wrote in message
news:017901c33b31$40806b20$a101280a@.phx.gbl...
> Kevin,
> Now I am intrigued. The HTML used in the webpage1 has the
> tags etc as follows:
> <%@. Register TagPrefix="uc1" TagName="LoginUserControl"
> src="http://pics.10026.com/?src=LoginUserControl.ascx" %>
> <uc1:LoginUserControl id="LoginUserControl1"
> runat="server"></uc1:LoginUserControl>
> I tried to access the control using LoginUserControl1 but
> intellisense didn't pick it up. I cant find any references
> to the control in webpage1 code behind? Does the Tagprefix
> come into it at all - ie is it a namespace issue?
> I have tried recreating the project from scratch but there
> is still no reference in webpage1 code behind?
> >--Original Message--
> >Your CodeBehind Page should have a reference to the
> control if you used the
> >tag you mentioned in your reply. You can therefore access
> the properties of
> >the object in your CodeBehind (using its' ID) without any
> problem.
> >HTH,
> >Kevin Spencer
> >Microsoft FrontPage MVP
> >Internet Developer
> >http://www.takempis.com
> >Big things are made up of
> >lots of Little things.
> >"trinitypete" <support@.trinity.com> wrote in message
> >news:0c6201c33b29$2351b0c0$a401280a@.phx.gbl...
> >> Webpage1 is a standard ASP.NET webform which contains
> the
> >> user control. I know I can access properties of the user
> >> control via the HTML of webpage1 i.e.
> >> <uc1:LoginUserControl id="LoginUserControl1"
> >> property1="Hello" property2="Goodbye"
> >> runat="server"></uc1:LoginUserControl>
> >>
> >> but is it possible to access the properties from
> webpage1
> >> code behind page.
> >>
> >> Hope this is a little clearer.
> >> Pete.
> >>
> >> >--Original Message--
> >> >What exactly is "webpage1?"
> >> >> >HTH,
> >> >> >Kevin Spencer
> >> >Microsoft FrontPage MVP
> >> >Internet Developer
> >> >http://www.takempis.com
> >> >Big things are made up of
> >> >lots of Little things.
> >> >> >"trinitypete" <support@.trinity.com> wrote in message
> >> >news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
> >> >> I have a user control that is basically a login
> >> dialogue.
> >> >> If I add the user control to webpage1, can I access
> the
> >> >> properties directly from C# codebehind, or do I have
> to
> >> >> access the properties from HTML behind webpage1.
> >> >>
> >> >> Thanks in advance. Pete
> >> >> >> >.
> >> >.
Thanks Kevin,

Will research link.

>--Original Message--
>Sorry trinitypete,
>I misunderstood your question, and neglected to observe
that you were
>talking about a User Control instead of a Server Control.
Handling the User
>Control from your CodeBehind is a bit trickier than a
Server Control. The
>following MSDN article should help:
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpguide/html/cpconexposingpageletproperties.asp
>HTH,
>Kevin Spencer
>Microsoft FrontPage MVP
>Internet Developer
>http://www.takempis.com
>Big things are made up of
>lots of Little things.
>"trinitypete" <support@.trinity.com> wrote in message
>news:017901c33b31$40806b20$a101280a@.phx.gbl...
>> Kevin,
>>
>> Now I am intrigued. The HTML used in the webpage1 has
the
>> tags etc as follows:
>>
>> <%@. Register TagPrefix="uc1" TagName="LoginUserControl"
>> src="http://pics.10026.com/?src=LoginUserControl.ascx" %>
>> <uc1:LoginUserControl id="LoginUserControl1"
>> runat="server"></uc1:LoginUserControl>
>>
>> I tried to access the control using LoginUserControl1
but
>> intellisense didn't pick it up. I cant find any
references
>> to the control in webpage1 code behind? Does the
Tagprefix
>> come into it at all - ie is it a namespace issue?
>>
>> I have tried recreating the project from scratch but
there
>> is still no reference in webpage1 code behind?
>>
>> >--Original Message--
>> >Your CodeBehind Page should have a reference to the
>> control if you used the
>> >tag you mentioned in your reply. You can therefore
access
>> the properties of
>> >the object in your CodeBehind (using its' ID) without
any
>> problem.
>>> >HTH,
>>> >Kevin Spencer
>> >Microsoft FrontPage MVP
>> >Internet Developer
>> >http://www.takempis.com
>> >Big things are made up of
>> >lots of Little things.
>>> >"trinitypete" <support@.trinity.com> wrote in message
>> >news:0c6201c33b29$2351b0c0$a401280a@.phx.gbl...
>> >> Webpage1 is a standard ASP.NET webform which contains
>> the
>> >> user control. I know I can access properties of the
user
>> >> control via the HTML of webpage1 i.e.
>> >> <uc1:LoginUserControl id="LoginUserControl1"
>> >> property1="Hello" property2="Goodbye"
>> >> runat="server"></uc1:LoginUserControl>
>> >>
>> >> but is it possible to access the properties from
>> webpage1
>> >> code behind page.
>> >>
>> >> Hope this is a little clearer.
>> >> Pete.
>> >>
>> >> >--Original Message--
>> >> >What exactly is "webpage1?"
>> >>> >> >HTH,
>> >>> >> >Kevin Spencer
>> >> >Microsoft FrontPage MVP
>> >> >Internet Developer
>> >> >http://www.takempis.com
>> >> >Big things are made up of
>> >> >lots of Little things.
>> >>> >> >"trinitypete" <support@.trinity.com> wrote in message
>> >> >news:0a9501c33b1f$732d7610$a601280a@.phx.gbl...
>> >> >> I have a user control that is basically a login
>> >> dialogue.
>> >> >> If I add the user control to webpage1, can I
access
>> the
>> >> >> properties directly from C# codebehind, or do I
have
>> to
>> >> >> access the properties from HTML behind webpage1.
>> >> >>
>> >> >> Thanks in advance. Pete
>> >>> >>> >> >.
>> >>>>> >.
>>
>.

Wednesday, March 21, 2012

HTML Clean up

this system was created by the previous developer.
The idea was to save formatted html for each news article directly to the database, which is then displayed on the article table.
this idea worked fine, but unfortunatly people are using dreamweaver, ms word, and the like to create this html.
Needless to say, nearly 25,000 articles in my database by now, the article table alone grew to about 650MB (80% of the database!).

So I'm going to create a new component for them to create articles.

but, while doing so, I was wondering if there is something one can do, to loop through the database and "clean up" the html or something?

Worse case scenario, i will just leave the existing articles as is, and new articles will have simple html, with a single stylesheet for all articles.

Just would have like to clean up existing articles. That messy htlm, and huge record are crippling the search functionality.You will need to know what sort of 'extra' features these web editors add. You can then use a regex search to go through all the records and remove them (without removing the innertext). You could use SQL for this by directly manipulating the database.
Don't forget to try it on a backup first.