25 new messages in 14 topics - digest


== 1 of 2 ==
Date: Thurs, May 8 2008 11:49 pm
From: "Chris"


I tested with this line:
response.write(e.Row.Cells(3).Text) which gives nothing ....
but, as i wrote, the gridview renders correctly the values.


"Chris" <ssd@qsd.dc> schreef in bericht
news:%23NXS0FVsIHA.4492@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> i want to make the forecolor of values into a gridview red but only when
> they equals 'n'.
>
> <asp:GridView ID="GridView1" runat="server"
>        DataKeyNames="hour,place" DataSourceID="SqlDataSource1" >
>       <Columns>
>            <asp:CommandField ShowEditButton="True"/>
>            <asp:BoundField DataField="place" HeaderText="place"
> ReadOnly="True" />
>            <asp:BoundField DataField="hour" HeaderText="hour"
> ReadOnly="True" />
>
>            <asp:TemplateField HeaderText="theday">
>                    <EditItemTemplate>
>               <asp:DropDownList ID="DropDownList1" SelectedValue='<%#
> Bind("theday") %>' runat="server">
>               <asp:ListItem Text="y" Value="y"></asp:ListItem>
>                <asp:ListItem Text="n" Value="n"></asp:ListItem>
>               </asp:DropDownList>
>                    </EditItemTemplate>
>                    <ItemTemplate>
>             <asp:Label ID="Label2" runat="server" Text='<%# Bind("theday")
> %>'></asp:Label>
>                    </ItemTemplate>
>                </asp:TemplateField>
>
>      </Columns>
> </asp:GridView>
>
>
> Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.GridViewRowEventArgs) Handles
> GridView1.RowDataBound
>
>        If e.Row.RowType = DataControlRowType.DataRow Then
>            Dim m As String
>            m = e.Row.Cells(3).Text
>           If m = "n" Then
>                e.Row.Cells(3).ForeColor = Drawing.Color.Red
>            End If
>       End If
>    End Sub
>
> The values are correctly rendered, i can update etc ... but the forecolor
> remains black. Is this due to the template?
> Thanks for help
> Chris
>






== 2 of 2 ==
Date: Fri, May 9 2008 3:10 am
From: "Mark Rae [MVP]"


"Chris" <ssd@qsd.dc> wrote in message
news:ugEdPDasIHA.4544@TK2MSFTNGP04.phx.gbl...

> I tested with this line:
> Response.Write(e.Row.Cells(3).Text) which gives nothing ....

Judging by your markup, that would be correct...

> but, as I wrote, the GridView renders correctly the values.

No doubt, but not in the way you think.

Please clarify which of the columns in the GridView (you think) corresponds
to e.Row.Cells(3)...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net






==============================================================================
TOPIC: Encrypting Webconfig file values in .Net 1.1 Framework
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/b2ce73f6f38ef6b1?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, May 9 2008 12:19 am
From: Mark Stevens


On Thu, 8 May 2008 21:04:51 +0100, "Mark Rae [MVP]"
<mark@markNOSPAMrae.net> wrote:

>I'm curious as to why you need to do this...

It is always prudent to encrypt sensitive information and connection
strings fall into this category.  Given that MS have provided an API
and method of doing this they obviously feel the same way.

Cheers,
Mark
--
      |\      _,,,---,,_          A picture used to be worth a
ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
     |,4-  ) )-,_. ,\ (  `'-'     came television!
    '---''(_/--'  `-'\_)

Mark Stevens  (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".




== 2 of 2 ==
Date: Fri, May 9 2008 2:55 am
From: "Mark Rae [MVP]"


"Mark Stevens" <nevyn@nospam.nospam> wrote in message
news:aiu724948qaa812kp9je80heae448toi93@4ax.com...

>>I'm curious as to why you need to do this...
>
> It is always prudent to encrypt sensitive information and connection
> strings fall into this category.

Are you worried that someone might hack your server and steal a copy of
web.config? If so, then the file's contents are surely the least of your
worries...

> Given that MS have provided an API and method of doing this they
> obviously feel the same way.

The Cryptography namespace is not *just* for web.config - it can be used to
encrypt anything...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net






==============================================================================
TOPIC: Use class ... why is not available?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/1137f4c408c684a8?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 12:26 am
From: Mark Stevens


I am having the same problem but with Web Applications on VS 2005. Now
I know about the problem it is more of an inconvenience than a problem
for us.  I was hoping that this problem would go away when we migrate
to VS 2008 later this month.

Also, Crystal Reports files (rpt) need their type set to content
otherwise the installer does not copy them for installation.  Again,
more of an inconvenience than a problem.

Cheers,
Mark

On Thu, 8 May 2008 11:47:22 -0700 (PDT), shapper <mdmoura@gmail.com>
wrote:


>> > I think the problem is where the classes are being added to.
>> > App_Folder or somewhere else.
>>
>> > I created a Web Application Project.
>>
>> > When I add a class to App_Folder it VS 2008 makes "Build: Content". If
>> > I add the class somewhere else it says "Build: Compile".
>>
>> > The problem is when I create classes in App_Folder they don't seem to
>> > be accessible to ASPX pages as it is usual in Web Site.
>>
>> > When I changed them "Build: Compile" then I am able to build the
>> > solution with no errors but when I preview an ASPX pages I get errors
>> > everywhere.
>>
>> > The only solution I found was to make all classes "Build: Compile" and
>> > rename the App_Code folder to New_App_Code.
>>
>> > I think I am missing something.
>>
>> > Any idea?
>>
>> > Thanks,
>>
>> > Miguel
>
>Sorry, when I wrote App_Folder I meant App_Code ... and that is the
>strange problem!
>
>Thanks,
>Miguel
--
      |\      _,,,---,,_          A picture used to be worth a
ZZZzzz /,`.-'`'    -.  ;-;;,       thousand words - then along
     |,4-  ) )-,_. ,\ (  `'-'     came television!
    '---''(_/--'  `-'\_)

Mark Stevens  (mark at thepcsite fullstop co fullstop uk)

This message is provided "as is".





==============================================================================
TOPIC: Making Multiple Themes Available (but not automatically applied) To All
Sites on a Web Server
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/7cf894830dc3c5f8?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, May 9 2008 1:11 am
From: "Cramer"


Using 3.5: Suppose I have defined 20+ themes (including multiple graphics,
.skin files, and css files per theme), and I want to make those themes
*available* to all the Web sites on my Web server. How can I accomplish this
"making them available" without having the themes all automatically applied
to each Web site?

I understand that I can create "global themes" by placing the theme folders
in %WINDOWS%\Microsoft.NET\Framework\[version]\ASP.NETClientFiles\Themes ...
but my concern is that themes placed there would automatically be *applied*
and not simply *available* to the sites on the server.

Thanks!







== 2 of 2 ==
Date: Fri, May 9 2008 3:26 am
From: Stan


On 9 May, 09:11, "Cramer" <A...@B.com> wrote:
> Using 3.5: Suppose I have defined 20+ themes (including multiple graphics,
> .skin files, and css files per theme), and I want to make those themes
> *available* to all the Web sites on my Web server. How can I accomplish this
> "making them available" without having the themes all automatically applied
> to each Web site?
>
> I understand that I can create "global themes" by placing the theme folders
> in %WINDOWS%\Microsoft.NET\Framework\[version]\ASP.NETClientFiles\Themes ...
> but my concern is that themes placed there would automatically be *applied*
> and not simply *available* to the sites on the server.
>
> Thanks!

Global themes are not "automatically applied" unless the pages section
of the machine.config file has the setting "theme=..."

If that is not the case then global themes can be referenced at site
level in the pages section of web.config or at page level in the
@pages directive.






==============================================================================
TOPIC: Programmatically Creating Themes and Skins
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/4c73edd804d7abec?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, May 9 2008 1:23 am
From: "Cramer"


According to the MSDN docs, we cannot programatically create our own themes
or skins:
"Page and control developers do not use the ControlSkinDelegate,
ControlSkin, or PageTheme classes directly. These classes are used by the
ASP.NET parser and runtime ... " (from
http://msdn.microsoft.com/en-us/library/system.web.ui.pagetheme.aspx).

My question:
Is there really no way that we can programmatically create our own themes
and have ASP.NET apply them to our pages and controls? I would like to
programmatically create my own themse, and not have to go with the expected
App_Themes directory for all of my themes. Is there some alternative I can
use?

Thanks







== 2 of 2 ==
Date: Fri, May 9 2008 2:55 am
From: Stan


On 9 May, 09:23, "Cramer" <A...@B.com> wrote:
> According to the MSDN docs, we cannot programatically create our own themes
> or skins:
> "Page and control developers do not use the ControlSkinDelegate,
> ControlSkin, or PageTheme classes directly. These classes are used by the
> ASP.NET parser and runtime ... " (fromhttp://msdn.microsoft.com/en-us/library/system.web.ui.pagetheme.aspx).
>
> My question:
> Is there really no way that we can programmatically create our own themes
> and have ASP.NET apply them to our pages and controls? I would like to
> programmatically create my own themse, and not have to go with the expected
> App_Themes directory for all of my themes. Is there some alternative I can
> use?
>
> Thanks

You can change the allocation of themes to controls programatically
just as you can dynamically associate CSS classes and styles. However
the dynamic creation of new style sheets and skin files is outside
their designed purpose. The location of the theme files is fixed
because that is where ASP.NET has been hard coded to expect them (or
maybe set in machine.config).

I'm not suggesting that this can't be circumvented in some way but I
wonder whether it's worth the effort. If there is a need to vary style
attributes at run time based on some computed criteria, then it
doesn't have to come from style sheets or skin files. It could be
derived from re-useable code of your own creation (e.g. in a class
file) consisting of functions returning style objects or other control
properties either based on the values supplied as parameters or on a
different function for each theme. It requires a bit of ingenuity but
at least the end result will be more system friendly and supportable.







==============================================================================
TOPIC: Citrix "The Page cannot be displayed"
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/fcc2c073ff5635fa?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 1:57 am
From: stcheng@online.microsoft.com (Steven Cheng [MSFT])


Hi Peter,

Have you tried using some trace tool(such as the web development helper for
IE) to watch the http traffic for the problem page to see whether there is
anything abnormal? I haven't a citrix environment on hand and cannot
perform the exact test,.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: "Peter" <czupet@nospam.nospam>
>References: <uPhI7fIsIHA.2188@TK2MSFTNGP04.phx.gbl>
<ewT9RwNsIHA.3680@TK2MSFTNGP05.phx.gbl>
>Subject: Re: Citrix "The Page cannot be displayed"
>Date: Thu, 8 May 2008 23:29:36 -0500

>
>
>"Anthony Jones" <Ant@yadayadayada.com> wrote in message
>news:ewT9RwNsIHA.3680@TK2MSFTNGP05.phx.gbl...
>> "Peter" <czupet@nospam.nospam> wrote in message
>> news:uPhI7fIsIHA.2188@TK2MSFTNGP04.phx.gbl...
>>> I have the following code which works fine in IE6 and IE7 and FireFox,
>>> but
>>> when I run IE6 on Citrix I get "The page cannot be displayed" in the
>> iframe.
>>> We don't have IE7 on Citrix so I can't try it.
>>>
>>>   <span id="ShowReport" disabled="disabled"
>>> style="display:inline-block;height:1200px;width:880px;">
>>>        <div>
>>>            <iframe src=../../WsiLogo.gif> <frame src=../../WsiLogo.gif>
>>> <embed src=../../WsiLogo.gif> </iframe>
>>>       </div>
>>> </span>
>>>
>>>
>>> I know little about Citrix and our Citrix admin knows little about HTML,
>> so
>>> between two of us we know nothing.
>>>
>>> Does anyone have any suggestions on how to fix this?
>>>
>>
>>
>> The HTML doesn't appear to make a great deal of sense.
>>
>> Try a very simple page that only has this in the body:-
>>
>> <iframe src="../../WsiLogo.gif"></iframe>
>>
>> Consider using an absolute path instead of the relative one you are using
>> here.
>>
>> I can't see anything here that Citirix itself would impact.
>>
>> BTW, why are you opening a gif in an IFrame?  Try visiting the URL to the
>> gif directly using IE address bar, what happens?
>>
>>
>>
>> --
>> Anthony Jones - MVP ASP/ASP.NET
>>
>>
>
>I tried the following on Citrix
>
>http://reports01/reports/WsiLogo.gif
>
>and got the same error "The Page cannot be displayed"
>
>but if I try
>
>http://reports01/reports/Test.html
>
>it works just fine
>
>and if I try on none-citrix computer everything works.
>
>
>






==============================================================================
TOPIC: KeyBoard Layout
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/8fbca916f573fe0f?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 2:49 am
From: Arnab das


ok I am sorry. I will post there.

Mark Rae [MVP] wrote:
> "Arnab das" <arnabit@gmail.com> wrote in message
> news:83b9cda0-4369-4770-b977-d1d23f7313c7@w7g2000hsa.googlegroups.com...
>
> > Currenlty I am working on KeyBoarLayout in C#. I donot know how to
> > change the keyboardlayout .I am creating a software similar to "Avro
> > KeyBoard 4.5.1". Thanks in advance.
>
> I think you're in the wrong newsgroup - this is for ASP.NET.
>
> For C# WinForms applications, please post to:
> microsoft.public.dotnet.languages.csharp
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net





==============================================================================
TOPIC: http xml post
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/d2bcfdfc91ccdf4d?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, May 9 2008 4:26 am
From: "Cindy H"


That makes sense - I'll check it out and get back to you on this.
Thanks a lot - I think you got me on the right road.


"bruce barker" <nospam@nospam.com> wrote in message
news:e4UqfBZsIHA.3716@TK2MSFTNGP04.phx.gbl...
> generally this means they want a form post with one form field containing
> the xml. in this case your post data is:
>
> string postdata = "fieldname=" + HttpUtility.UrlEncode(doc.OuterXml);
>
> note: you should set the content-type to:
> application/x-www-form-urlencoded
>
> -- bruce (sqlwork.com)
>
>
> CindyH wrote:
>> Hi
>>
>> I'm working on a http xml post (request/response).
>>
>> In my testing - I have been able to create and post xml string/stream and
>> send response
>> back.
>>
>> But now I've been told that I should "code the whole xml payload string
>> as a
>> single key"
>>
>> I'm not sure what this means and haven't been able to find anything about
>> it.
>>
>> Can anyone help me with this?
>>
>> Thanks,
>> Cindy
>>





== 2 of 3 ==
Date: Fri, May 9 2008 5:55 am
From: "CindyH"


Hi

I'm wondering how I go about reading this for sending a reponse back.

Currently, I'm using:

Stream = New System.IO.StreamReader(Page.Request.InputStream)

Reader = New System.Xml.XmlTextReader(Stream)

Do While Reader.Read()

This of course doesn't work with httputility.urlencode(doc.outerxml) as a
post

Thanks,

Cindy

"bruce barker" <nospam@nospam.com> wrote in message
news:e4UqfBZsIHA.3716@TK2MSFTNGP04.phx.gbl...
> generally this means they want a form post with one form field containing
> the xml. in this case your post data is:
>
> string postdata = "fieldname=" + HttpUtility.UrlEncode(doc.OuterXml);
>
> note: you should set the content-type to:
> application/x-www-form-urlencoded
>
> -- bruce (sqlwork.com)
>
>
> CindyH wrote:
>> Hi
>>
>> I'm working on a http xml post (request/response).
>>
>> In my testing - I have been able to create and post xml string/stream and
>> send response
>> back.
>>
>> But now I've been told that I should "code the whole xml payload string
>> as a
>> single key"
>>
>> I'm not sure what this means and haven't been able to find anything about
>> it.
>>
>> Can anyone help me with this?
>>
>> Thanks,
>> Cindy
>>





== 3 of 3 ==
Date: Fri, May 9 2008 7:32 am
From: Martin Honnen


CindyH wrote:

> This of course doesn't work with httputility.urlencode(doc.outerxml) as a
> post

If the data is posted as application/x-www-form-urlencoded then you can
access it with
  Request.Form("fieldname")
so
  Using reader As XmlReader = XmlReader.Create(new
StringReader(Request.Form("fieldname")))
    While reader.Read()
      '...
    End While
  End Using

--

       Martin Honnen --- MVP XML
       http://JavaScript.FAQTs.com/





==============================================================================
TOPIC: How to store image in sesstion ?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/29fe3df2ac12bff9?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 4:54 am
From: "harshad"


Dear All,Here I am facing problem to store image.I am trying to store  byte
array(image) in to session variable so at time of update I will got that
byte array and I do my update. here i am given following code so kindly help
out me. on Button Click Event---------------------------------
       Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnUpload.Click
       Try
           ' Dim fileUpload1 As FileUpload =
CType(Me.FindControl("fpPhoto"), FileUpload)
           'Make sure a file has been successfully uploaded
           If fpPhoto.PostedFile Is Nothing OrElse
String.IsNullOrEmpty(fpPhoto.PostedFile.FileName) OrElse
fpPhoto.PostedFile.InputStream Is Nothing Then
               lblerror.Text = "Please Upload Valid picture file"
               Exit Sub
           End If
           Session("Path") = fpPhoto.PostedFile.FileName.ToString
           'Make sure we are dealing with a JPG or GIF file
           Dim extension As String =
System.IO.Path.GetExtension(fpPhoto.PostedFile.FileName).ToLower()
           Dim MIMEType As String = Nothing
           Select Case extension
               Case ".gif"
                   MIMEType = "image/gif"
               Case ".jpg", ".jpeg", ".jpe"
                   MIMEType = "image/jpeg"
               Case ".png"
                   MIMEType = "image/png"
               Case Else
                   'Invalid file type uploaded
                   Label1.Text = "Not a Valid file format"

                   Exit Sub
           End Select

           ImgPhoto.ImageUrl = fpPhoto.PostedFile.FileName
           'Connect to the database and insert a new record into Products
           Dim imageBytes(fpPhoto.PostedFile.InputStream.Length) As Byte
           fpPhoto.PostedFile.InputStream.Read(imageBytes, 0,
imageBytes.Length)
           Photo = imageBytes



'           Session("Photo") = Photo




       Catch ex As Exception
           Throw ex
       End Try
   End Sub


------------------------------
update called by following
---------------------------------


Photo = CType(Session("Photo"), Byte())
UpdatePH_ID(Session("PH_ID_NO"), Session("DistID"), Photo)
--------------------------------------------------------------

CLASS FILE
------------------------
-----------------------
member Variable
-----------------
Private mPhoto As Byte() = Nothing
---------------
Property
---------------------
Public Property Photo() As Byte()
       Get
           Return mPhoto
       End Get
       Set(ByVal Value() As Byte)
           mPhoto = Value
       End Set
   End Property
--------------
function
---------------
Public Sub UpdatePH_ID(ByVal id As Integer, ByVal id1 As Integer, ByVal p As
Byte())
       'Make the object of the class that is supporting this Web Service

       'Make the dataset that is to be used thoughout here
       Dim objParameter As New cParameter(ds)

       'Make the objParameter ready for insert
       getCollection(objParameter, 2, id, id1, p, False)
       'Make the dataset ready by filling it
       If objservices.UpdateSJEDPH_ID1PhotoData(ds) = 1 Then
           MsgBox("Photo for the current document is updated!")
       End If

      End Sub
   Private Sub getCollection(ByRef objParameter As cParameter, ByVal index
As Int16, ByVal id As Integer, ByVal id1 As Integer, ByVal p As Byte(),
Optional ByVal common As Boolean = False)
       If IsNothing(objParameter) Then
           objParameter = New cParameter(ds)
       End If
       'objParameter.CreateParameter(dsEntry, "UserID",
My.Application.UserInfo.UserID.ToString)
       'objParameter.CreateParameter(dsEntry, "OfficeID",
My.Application.UserInfo.OfficeID.ToString)
       'objParameter.CreateParameter(dsEntry, "RoleID",
My.Application.UserInfo.RoleID.ToString)

       Dim param As SqlParameter() = New SqlParameter(2) {}

       param(0) = New SqlClient.SqlParameter("@PH_ID_NO1", ID)
       param(1) = New SqlClient.SqlParameter("@dist_cd", id1)
       param(2) = New SqlClient.SqlParameter("@Photo", p)

       Dim drEntryPage As DataRow
       ds.Tables("Parameter").Columns.Add("Photo", GetType(Byte()))
       ds.Tables("Parameter").Columns.Add("Thumb", GetType(Byte()))
       drEntryPage = ds.Tables("Parameter").NewRow()
       SetValue(drEntryPage)
       ds.Tables("Parameter").Rows.Add(drEntryPage)

   End Sub
   Private Sub SetValue(ByRef drEntryPage As DataRow)
       Try
           With drEntryPage
               '.Item("SrNo") = DBNull.Value
               '.Item("DocumentID") = DBNull.Value
               '.Item("DocumentRefID") = DBNull.Value
               '.Item("PhotoThumbID") = strPK
               .Item("PName") = "Photo"
               .Item("PValue") = Photo
               .Item("PType") = enmParameterType.Input
               .Item("DBType") = SqlDbType.Image
               .Item("Photo") = Photo

               '.Item("UserID") = My.Application.UserInfo.UserID
               '.Item("OfficeID") = My.Application.UserInfo.OfficeID
               '.Item("RoleID") = My.Application.UserInfo.RoleID
           End With
       Catch ex As Exception
           Throw ex
       End Try
   End Sub



----------------------
web services
-----------------------
<WebMethod()> _
   Public Function UpdateSJEDPH_ID1PhotoData(ByRef ds As DataSet) As
Integer
       Dim param As SqlParameter() = Nothing
       Dim id As Integer
       Dim i As Integer
       param = New SqlParameter(ds.Tables(0).Rows.Count - 1) {}
       For i = 0 To ds.Tables("Parameter").Rows.Count - 1
           If Not IsDBNull(ds.Tables(0).Rows(i).Item(1)) AndAlso
ds.Tables(0).Rows(i).Item("DBType").ToString = "Image" Then
               param(i) = New
SqlParameter(ds.Tables(0).Rows(i).Item(0).ToString,
ds.Tables(0).Rows(i).Item("Photo"))
           Else
               param(i) = New
SqlParameter(ds.Tables(0).Rows(i).Item(0).ToString,
ds.Tables(0).Rows(i).Item(1))
           End If
       Next i
       id = SqlHelper.ExecuteScalar(getConnectionString(),
CommandType.StoredProcedure, "UpdateSJEDPH_ID1PhotoData", param)
       Return id
   End Function







==============================================================================
TOPIC: javascript file won't work with .cs file...
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/b3d042edb660c0cd?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 5:00 am
From: "Matthew Wells"


There is no syntax error.  I copy and paste the code in the aspx page and it
works fine.  If there were a syntax error, nothing would work.  I know I"m
using the included script properly because the second function works. The
problem I think is in the timing of when the script is added and the event
is set to the button.

From the aspx.cs OnLoad event...

btnFirst.OnClientClick = "return btnFirst_Click()"

the javascript function for that event is

function btnFirst_Click()
{
   alert("This is btnFirst_Click");
   return false;
}

This doesn't work, but this does

function Button1_Click()
{
   alert("This is ShowAlert");
   return false;
}

In the property page for Button1, I manually put "ShowAlert()" in the
OnclientClick event - it works that way.

I even switched the functions and still the one that is bound in the aspx.cs
code won't work.

Does someone else have a clue?





"bruce barker" <nospam@nospam.com> wrote in message
news:ucOkdDZsIHA.3716@TK2MSFTNGP04.phx.gbl...
> you don't give enough info to know what you are doing wrong. there is no
> difference between inline script or included script.
>
> try using firefox to debug the script, you must have a syntax error.
>
> -- bruce (sqlwork.com)
>
>
> Matthew Wells wrote:
>> Hello.  I'm reposting this because my prioe post's subject line was
>> incorrect.
>>
>>     I'm developing an asp.net 2.0 project using VS 2005 on XP sp2 with
>> all
>> the updates.  I have an aspx page with javascript that works fine until I
>> try to separate the script into a .js file.  I've found that only the
>> script
>> that is called from events set in the aspx.cs file don't work.  I
>> eliminated
>> all script except two functions.  One is used with the .cs file and the
>> other one is not.
>>
>> First, here's the functino used with the .cs file:
>> if (!this.IsPostBack)
>> {
>>
>> btnFirst.OnClientClick = "return btnFirst_Click()";
>>
>> }
>> ... the javascript function is...
>>
>>
>> function btnFirst_Click()
>>
>> {
>>
>> alert("This is btnFirst_Click"):
>>
>> return false;
>>
>> }
>>
>> Now the second javascript function is only
>>
>> function ShowAlert()
>> {
>>     alert("This is ShowAlert");
>>     return false;
>> }
>>
>> This function is called from another button - button1 - from the
>> OnClientClick event which I set in the property page..
>>
>> When I have all the javascript in the aspx page, it all wokrs, but when I
>> move it to a .js file, the first function doesn't work, but the second
>> one
>> does.
>>
>> I don't want to add all my javascript in rhe .cs file because that would
>> expose all my code - that's why I'm teying to put it in a .js file.
>>
>> How can I make all the code work using both methods?
>>
>> Thanks...
>>







==============================================================================
TOPIC: When does a Bound Control DataBind?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/cd36393077dd4c66?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 5:38 am
From: Manish


Hi Jonathan,

Please know that if you bind the dropdownlist control at design time with
some datasource then also specify also specify its text and value fields to
one of the column of the table. then you do not need to bind the dropdownlist
at run time.

Also, you can set the Selected Value of the control by calling

 Me.DropDownList1.SelectedValue = 76

but for that dropdownlist control should be bound.

Regards,
Manish
www.componentone.com



"Jonathan Wood" wrote:

> I have a databound dropdownlist control. Based on some other criteria, I
> need to specify the selected item in my pages Load event.
>
> The problem is that, in my load event, the control does not yet have any
> data. I've found I can call DataBind() on that control and then it works
> okay. However, this has me wondering where the control normally databinds,
> and if me doing it manually would actually introduce the overhead of having
> the control databind twice.
>
> Can anyone answer these questions?
>
> 1. Does a control know it's been databound such that it will not repeat the
> process unecessarily?
>
> 2. Is there a better way to specify the selected value of a control that has
> not yet databound?
>
> Thanks!
>
> --
> Jonathan Wood
> SoftCircuits Programming
> http://www.softcircuits.com
>
>





==============================================================================
TOPIC: Database issue
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/ce0f9d4fc017eba6?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, May 9 2008 6:39 am
From: "BD"


Thanks again Cowboy.  I'll be checking your blog.  Really all I need it the
ability to track the info.  Displaying it on the pages is not a requirement.
It's just so that I can open a private page and see what the stats are.  I
don't really want to use the separate counter file pages for each page that
the user sees. I'm also looking at the possibility of tracking it with XML
or an INI file.
BD

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:OtRHbDYsIHA.6096@TK2MSFTNGP06.phx.gbl...
> Here is a zip file of a counter application. I did not have time to move
> teh dataset creation and save routines to global.asax, so there is still
> some work to be done. It is C#. I tried to do VB, but it takes more time
> than I have for me to think in VB anymore. I apolgize up front. One of the
> easiest ways to translate is publish the website, which compiles it, and
> look at the code in Reflector (Lutz Roeder), a mandatory tool for .NET
> devs, IMO.
>
> Here are some things to note:
> 1. Open Counters.xml and see that only one of the two pages has a counter
> 2. Hit both pages. You can go back and forth and see how the counters
> work - If they saved back to the XML file, you would also see that you can
> quit the application. I am not sure when I will find more time, so you can
> lookup Application_Start and counters and try yourself. It will not work
> with pagePath, as it is a Uri, not a regular path. There is a routine for
> getting application path in .NET. I just don't have it at the top of my
> head.
>
> The application is designed to add new pages. All you have to do to see
> the counter is place it on a label or something. If you want a prettier
> counter, I would create a user control that pulls images 1-10 and turn the
> count into a string and read each character. Something like:
>
> <!-- in page -->
> <asp:Panel ID="HitCounterPanel" runat="Server"/>
>
> //In Code
> HitCounterPanel.Controls.Clear();
> string hitsAsString = hits.ToString();
> char[] hitsAsArray = hitsAsString.ToCharArray();
>
> for(int i=0;i<hitsAsArray.Length;i++)
> {
>    Image img = new Image();
>    img.ImageUrl = "images/" + hitsAsArray[i] + ".gif";
>    HitCounterPanel.Coutrols.Add(img);
> }
>
> I may have a typo in that. If I get time, I can show you how easy it can
> be to use a database. I will likely do it on my blog so it has a wider
> audience.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
> http://gregorybeamer.spaces.live.com/lists/feed.rss
>
> or just read it:
> http://gregorybeamer.spaces.live.com/
>
> *************************************************
> | Think outside the box! |
> *************************************************
> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
> message news:eMXBxjXsIHA.4076@TK2MSFTNGP06.phx.gbl...
>> The read only can come from a couple of things:
>>
>> 1. Permissions on the file
>> 2. Permissions on the folder
>> 3. You have the file open while you are running your application
>>
>> The last is unique to file type databases, like Access, and will only
>> require a bit of discipline on your part.
>>
>> If you have an ISP that has a server type database, I would aim that
>> direction before using Access, personally. Many provide either SQL
>> Express
>> or mySQL. You can download both for free, so there is no cost issue here.
>>
>> That is a bit overkill for a simple page counter, however. I will post
>> back
>> something shortly.
>>
>> --
>> Gregory A. Beamer
>> MVP, MCP: +I, SE, SD, DBA
>>
>> Subscribe to my blog
>> http://gregorybeamer.spaces.live.com/lists/feed.rss
>>
>> or just read it:
>> http://gregorybeamer.spaces.live.com/
>>
>> *************************************************
>> | Think outside the box!
>> |
>> *************************************************
>> "BD" <JustMe@nothome.net> wrote in message
>> news:Ome6vsGsIHA.4848@TK2MSFTNGP05.phx.gbl...
>>> Thanks for the reply Cowboy.
>>> First off, I'm very new to ASP.Net and to ASP in general.  I'm used to
>>> doing my page code in straight HTML using FrontPage 2003.
>>> I really don't have any idea how to proceed with this and I'm just
>>> trying
>>> to muddle my way through it.  The reason for using the database was that
>>> there are several pages that will be tracked in that table and the DB
>>> also
>>> has another table that I want to implement later for tracking downloads
>>> of
>>> zip and exe files which are available on the site.
>>> The error is that the database is read only which I understand has to do
>>> with folder permissions.  I can probably solve that on IIS 6 which I use
>>> for testing only.  The pages finally end up on another server which is
>>> 2003 and I have no way (AFAIK) of setting folder permissions there.
>>> I'm open to any code that you think will do what I want but I warn you
>>> in
>>> advance that this will be a "Hold my hand" operation.
>>> Again, my gratitude for your help here.
>>> BD
>>>
>>> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote
>>> in
>>> message news:OQqc0lFsIHA.4912@TK2MSFTNGP03.phx.gbl...
>>>> First, I am not sure that a counter is best implemented in a database.
>>>> There are plenty of examples on the web of counters persisted in memory
>>>> and spun down and up as the application is started and stopped. You can
>>>> also persist hits to an XML file, if you would rather head that
>>>> direction.
>>>>
>>>> Second, even if you persist each hit to the database, I am not sure why
>>>> you are adding new  rows. It is a single value updated over and over
>>>> again, right?
>>>>
>>>> Third, why are you using old style ADO objects instead of ADO.NET
>>>> objects. There is really no need for this line:
>>>> Server.CreateObject("ADODB.Recordset")
>>>> other than familiarity with the old. ADO.NET will be faster and easier
>>>> to
>>>> debug than a COM object, as you have full exposure of what is going on.
>>>> When you use an ADODB.Recordset, the COM errors are trapped and .NET
>>>> exceptions thrown, which obfuscates what is actually going on.
>>>>
>>>> Finally, you are writing your ASP.NET like ASP, which is not the
>>>> optimal
>>>> way to do something like this.
>>>>
>>>> As for the error, what error are you recieving? One of the most common
>>>> errors comes from opening the Access database in Access while you are
>>>> trying to hit it with the web page. I forget the error number, but the
>>>> error message is completely unrelated to what is actually happening, in
>>>> most cases. You are probably not seeing this error anyway, as .NET is
>>>> trapping it and throwing its own exception.
>>>>
>>>> --
>>>> Gregory A. Beamer
>>>> MVP, MCP: +I, SE, SD, DBA
>>>>
>>>> Subscribe to my blog
>>>> http://gregorybeamer.spaces.live.com/lists/feed.rss
>>>>
>>>> or just read it:
>>>> http://gregorybeamer.spaces.live.com/
>>>>
>>>> *************************************************
>>>> | Think outside the box! |
>>>> *************************************************
>>>
>>>
>>
>>
>
>
>







==============================================================================
TOPIC: Remove JavaScript __doPostBack function
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/68995541d85ff094?hl=en
==============================================================================

== 1 of 5 ==
Date: Fri, May 9 2008 6:43 am
From: "Waldy"


Hi there,
             I have a customer requirement to provide a web application
without JavaScript.  A function is being written to the HTML output on some
pages.  The function is called __doPostBack.  How do I get rid of it.  There
is no call to the function in the rest of the page, so why is it being
written to the client?






== 2 of 5 ==
Date: Fri, May 9 2008 7:45 am
From: "darrel"


>              I have a customer requirement to provide a web application
> without JavaScript.  A function is being written to the HTML output on
> some pages.  The function is called __doPostBack.  How do I get rid of it.
> There is no call to the function in the rest of the page, so why is it
> being written to the client?

Have a link to the page to show us?

I believe that function is added by the .net framework. If it's not being
used by any of your controls (ie, you don't have AUTOPOSTBACK set to to
TRUE) then it won't necessarily hurt to have it there.

-Darrel






== 3 of 5 ==
Date: Fri, May 9 2008 7:51 am
From: bruce barker



_dopostback is rendered in three cases:

1) the page has a postback control that can only postback via javascript.
the only asp controls that don't need javascript to postback are the
asp:button and asp:imagebutton.

2) the page uses clientside validation. Set CauesValidation to false to turn
this off.

3) a command argument is specified for postback.

-- bruce (sqlwork.com)


"Waldy" wrote:

> Hi there,
>               I have a customer requirement to provide a web application
> without JavaScript.  A function is being written to the HTML output on some
> pages.  The function is called __doPostBack.  How do I get rid of it.  There
> is no call to the function in the rest of the page, so why is it being
> written to the client?
>
>
>




== 4 of 5 ==
Date: Fri, May 9 2008 8:07 am
From: "Waldy"


"bruce barker" <brucebarker@discussions.microsoft.com> wrote in message
news:69E6FB4C-5C38-42CE-88F3-106A15080ABE@microsoft.com...
> _dopostback is rendered in three cases:
>

Thanks Bruce,
                     but surely in each of those cases, there would be a
call to the function somewhere in the HTML output?






== 5 of 5 ==
Date: Fri, May 9 2008 8:14 am
From: "darrel"



>                      but surely in each of those cases, there would be a
> call to the function somewhere in the HTML output?

I'm looking at some asp.net 1.1 pages I've built purposely without any
javascript and I don't have that function there. So I would imagine you
might have a control you've missed that requires it. Can you post a link to
the page in question?

-Darrel







==============================================================================
TOPIC: C# question... What are INTERFACES used for?
http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/browse_thread/thread/b91455c6f03fd093?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, May 9 2008 8:21 am
From: S_K


Hi,
I've been toying around with interfaces in C#.
They are fun but can anybody give me some examples of where interfaces
are used
and what they are used for?

Thanks so much.
Steve




== 2 of 2 ==
Date: Fri, May 9 2008 8:29 am
From: "sloan"


http://www.google.com/search?hl=en&q=OO+Interfaces

They are the beginning of a long journey on the road of OO (Object Oriented)
Programming.

..




"S_K" <steve_kershaw@yahoo.com> wrote in message
news:757d2999-9101-4f03-9510-d3bd06d5e8ba@z16g2000prn.googlegroups.com...
> Hi,
> I've been toying around with interfaces in C#.
> They are fun but can anybody give me some examples of where interfaces
> are used
> and what they are used for?
>
> Thanks so much.
> Steve



No comments: