Saturday, March 31, 2012

Why is my store procedure not working in web browser?

Below is the store producedure that I use:

IFexists(SELECT [Outlook].[ID], [Outlook].[title], [Outlook].[name], [Outlook].[issueID]FROM [OLissue], [Outlook]WHERE([Outlook].[issueID]= @dotnet.itags.org.OLissueIDAND [Outlook].[issueID]= [OLissue].[issueID]))

SELECT [ID], [title], [name], [issueID]FROM [Outlook]WHERE([issueID]= @dotnet.itags.org.OLissueID)

ELSE

SELECTTOP 1NULL ID,'No parent page yet' titleFROM [Outlook]

The store procedure above works fine when run in Microsoft SQL Server Manager Studio but when run in the browser it's not working. Here is the Outlook table:

Column NameDate TypeAllow NullsIDintUncheckedmenubitCheckedmnuOrderintCheckedmnuLevelintCheckedparentintCheckedissueIDintUncheckedmasterPagevarchar(100)UncheckedvisiblebitCheckednamevarchar(50)Checkedtitlevarchar(250)Uncheckeddescriptionvarchar(1000)CheckedsummarytextCheckedcontentstextCheckedimagevarchar(50)CheckedimgCaptionvarchar(1000)CheckedapprovebitCheckedcreateDatedatetimeUnchecked

And the OLissue table:

Column NameDate TypeAllow NullsissueIDintUncheckednamevarchar(50)Uncheckedtitlevarchar(100)Checkeddescriptionvarchar(500)CheckedcrntIssuebitCheckedfrntPageintCheckedarchivedbitCheckednavOrderintCheckeddateCreatedatetimeChecked

Now, let me explain further how my web application works. I have two SqlDataSource controls in my .aspx page. The sqlOLpage control is to retrieve all the data in the Outlook table. The sqlParent control is set to use the above store procedure. In my .aspx page, I have a FormView control. In the Edit/Insert mode, I have a drop down list (ddlParent). The ddlParent DataSourceID is set to equal the sqlParent control. However, this ddlParent is set to Bind with the sqlOLpage control. I kept getting this error when enter the Edit mode:

'ddlParent' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.ArgumentOutOfRangeException: 'ddlParent' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

This error occurs when the Outlook.parent and the OLissue.frntpage field is NULL. However, what I don't understand is why is it that SQL Server Management Studio returns the record that is in the Outlook table fine.

Again, thank so much for any help.

the drop downlist takes aarguments one of the is the value and the other one is the string or item that you can see on the ddl. now when your sqlproc. returns null, the value will be null on the ddl and this action is not supported. you can do this, try to give a value for the null items like 0 or something on databond time.

check this link for more information about the same challange that you have.

http://forums.asp.net/p/648074/648671.aspx

hope this will help you


Thanks! I'll take a look at the link. However, what I do not understand is that the SP returns a valid value (not null) when run in SQL Server Management Studio. And yes, the DDL's display value is set totitle and the data field value is set toID and both of these records and the rest of the selecedt records returned fine when ran in sql mgmt. studio. So why is it not returned when using with a DDL control?


Okay, I test the sqlParent control inside of VS.net and it does return a valid record but still receive the error when running the whole page in the browser.


Okay, the problem seems to be coming from the dropdownlist control and not my store procedure. But if the SP does return a value, why is the dropdownlist having problem selecting?


Okay, I think got it...but still need help. I narrow the problem to the data binding. When the ID of SelectedValue in the DDL does not equal the returned value of the SP, it generates this error. If set the DDL control to unbound and I enter the edit mode fine without any errors and the DDL does show the returned value from the SP. So my question is, how do I avoid this error when in this situation and list the returned value from the SP but still binding to a database field?


Okay, by careful look at the scenareo again, I'm still confused about the DropDownList selectedValue property. Here is I did a test of the problem.

<asp:DropDownListID="DropDownList1"runat="server"DataSourceID="sqlParent"DataTextField="title"DataValueField="ID"SelectedValue='<%# Bind("ID") %>'></asp:DropDownList>

The above line generates the error stated above. If I take theSelectedValue='<%# Bind("ID") %>' out then it works fine. Now, I have a textBox like this:

<asp:TextBoxID="TextBox1"runat="server"Text='<%# Bind("ID") %>'></asp:TextBox><br/>

And the ID from the TextBox1 and DropDownList1 both equal so, why is there an error when I use the SelectedValue property on the DropDownList1?


Hi,

Based on my understanding, you want to set the SelectedValue to the DropDownList which exists in the FormView. When you set the value which be retrieved from database to the SelectedValue property, you get the error message above. If I have misunderstood you, please feel free to let me know.

We need to understand the DropDownList's SelectedValue property first. When we set the value to SelectedValue property, we have to make sure that the DropDownList contains this value. If it don't contain this value, we will get the error message above.

For more information, seeDropdownlist in a Gridview and the default (null) value problem.

I hope this helps.


Hey, thanks! That article seems to solves my problem for now. However, if I do Value="", will I get a null value insert into the database field? I data field is setup to accept null so it will be nice if it is null and not blank.


Okay, I just encounter the problem to my previous question. It seem that since the Value="", when I try to insert new record, there is a popup window kept telling me that I have the data in the wrong format. How do I resolve this error? How do I enter a null value is I didn't choose anything?


Any other idea, anyone?

Why is my XML file being written corrupt?

In our CMS, every time a page is updated, we spit out a new XML file.
This file is written via a function that queries the Database using a
recursive function, grabs the data, and writes out a file using
xmltextwriter:
Dim fs As New
System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath("/mjb05/x
ml/"
& siteID & "/siteMenu.xml").ToString, IO.FileMode.Open, IO.FileAccess.Write,
IO.FileShare.Read)
objXMLWriter = New System.xml.XmlTextWriter(fs, Nothing)
'objXMLWriter = New
System.xml.XmlTextWriter(System.Web.HttpContext.Current.Server.MapPath("/mjb
05/xml/"
& siteID & "/siteMenu.xml").ToString, Nothing)
objXMLWriter.Flush()
objXMLWriter.Formatting = objXMLWriter.Formatting.Indented
objXMLWriter.Indentation = 3
objXMLWriter.WriteStartDocument()
objXMLWriter.WriteComment("Created on " & Now())
objXMLWriter.WriteStartElement("menuItems")
createParentNode = False
...etc.
This works 99% of the time. However, if I change a particular value in one
of my table cells the writer still executes, but then writes out an invalid
ending to the file.
What is REALLY odd is that I can re-write the file a second time and it
fixes itself.
What is even odder (yes, it gets odder) is the way the file is corrupted.
It's appending a weird bit of broken nodes to the end of the file.
For instance, if my file SHOULD end like this:
</endNode>
</endAllItems>
the corrupted file might look like this:
</endNode>
</endAllItems>
</endNode>
</endAllItems>
or this:
</endNode>
</endAllItems>endNode>
</endAllItems>
or even just this:
</endNode>
</endAllItems>s>
Anyone have any ideas what could cause this type of weird corruption when
writing out an XML file?
-Darrel> This works 99% of the time. However, if I change a particular value in one
> of my table cells the writer still executes, but then writes out an
> invalid ending to the file.
Some more info:
I've looked at the data in the db when writing:
data record 1 = writes XML file
data record 2 = writex XML file
return to data record 1 = writes CORRUPTED file
write again with data record 1 = writes XML file
In all instance, the same variables are passed to the function that writes
out the xml file.
In addition, the corruption is random but consistent (make sense? ;o)
It's always one or two (possibly partial) repeats of the last node and the
parent node closing tags at the end of the file.
-Darrel
darrel wrote:
> Some more info:
> I've looked at the data in the db when writing:
> data record 1 = writes XML file
> data record 2 = writex XML file
> return to data record 1 = writes CORRUPTED file
> write again with data record 1 = writes XML file
> In all instance, the same variables are passed to the function that writes
> out the xml file.
> In addition, the corruption is random but consistent (make sense? ;o)
> It's always one or two (possibly partial) repeats of the last node and the
> parent node closing tags at the end of the file.
> -Darrel
>
To me it looks like a logic fault in your recursive functions. It might
be there is a fault in how elements are being closed and taken care of.
Step through the code for a small XML file and see where the problem is.
> To me it looks like a logic fault in your recursive functions. It might
> be there is a fault in how elements are being closed and taken care of.
> Step through the code for a small XML file and see where the problem is.
I'll give it a shot. However, my function is using xmlwriter to write out
individual nodes so even if it is a logic error, it's hard to figure out why
it would be writing half-tags.
I'll report back!
-Darrel

Why is my XML file being written corrupt?

In our CMS, every time a page is updated, we spit out a new XML file.

This file is written via a function that queries the Database using a
recursive function, grabs the data, and writes out a file using
xmltextwriter:

Dim fs As New
System.IO.FileStream(System.Web.HttpContext.Curren t.Server.MapPath("/mjb05/xml/"
& siteID & "/siteMenu.xml").ToString, IO.FileMode.Open, IO.FileAccess.Write,
IO.FileShare.Read)
objXMLWriter = New System.xml.XmlTextWriter(fs, Nothing)
'objXMLWriter = New
System.xml.XmlTextWriter(System.Web.HttpContext.Cu rrent.Server.MapPath("/mjb05/xml/"
& siteID & "/siteMenu.xml").ToString, Nothing)
objXMLWriter.Flush()
objXMLWriter.Formatting = objXMLWriter.Formatting.Indented
objXMLWriter.Indentation = 3
objXMLWriter.WriteStartDocument()
objXMLWriter.WriteComment("Created on " & Now())
objXMLWriter.WriteStartElement("menuItems")
createParentNode = False

...etc.

This works 99% of the time. However, if I change a particular value in one
of my table cells the writer still executes, but then writes out an invalid
ending to the file.

What is REALLY odd is that I can re-write the file a second time and it
fixes itself.

What is even odder (yes, it gets odder) is the way the file is corrupted.
It's appending a weird bit of broken nodes to the end of the file.

For instance, if my file SHOULD end like this:

</endNode>
</endAllItems
the corrupted file might look like this:

</endNode>
</endAllItems>
</endNode>
</endAllItems
or this:

</endNode>
</endAllItems>endNode>
</endAllItems
or even just this:

</endNode>
</endAllItems>s
Anyone have any ideas what could cause this type of weird corruption when
writing out an XML file?

-Darrel> This works 99% of the time. However, if I change a particular value in one
> of my table cells the writer still executes, but then writes out an
> invalid ending to the file.

Some more info:

I've looked at the data in the db when writing:

data record 1 = writes XML file
data record 2 = writex XML file
return to data record 1 = writes CORRUPTED file
write again with data record 1 = writes XML file

In all instance, the same variables are passed to the function that writes
out the xml file.

In addition, the corruption is random but consistent (make sense? ;o)

It's always one or two (possibly partial) repeats of the last node and the
parent node closing tags at the end of the file.

-Darrel
darrel wrote:
>> This works 99% of the time. However, if I change a particular value in one
>> of my table cells the writer still executes, but then writes out an
>> invalid ending to the file.
> Some more info:
> I've looked at the data in the db when writing:
> data record 1 = writes XML file
> data record 2 = writex XML file
> return to data record 1 = writes CORRUPTED file
> write again with data record 1 = writes XML file
> In all instance, the same variables are passed to the function that writes
> out the xml file.
> In addition, the corruption is random but consistent (make sense? ;o)
> It's always one or two (possibly partial) repeats of the last node and the
> parent node closing tags at the end of the file.
> -Darrel
>
To me it looks like a logic fault in your recursive functions. It might
be there is a fault in how elements are being closed and taken care of.
Step through the code for a small XML file and see where the problem is.
> To me it looks like a logic fault in your recursive functions. It might
> be there is a fault in how elements are being closed and taken care of.
> Step through the code for a small XML file and see where the problem is.

I'll give it a shot. However, my function is using xmlwriter to write out
individual nodes so even if it is a logic error, it's hard to figure out why
it would be writing half-tags.

I'll report back!

-Darrel

Why is my web site generating App_Data folder?

I created a Web Application Project in VS 2005.
The site is working fine in the development computer.
Then I transfer all my files and dll to the production computer.
I have a login form. If I try to log in, the production computer
automatically generates an App_Data folder (the development computer
doesn't have this folder at all) and it also generates an error saying
that I don't have SQL Server 2005, which of course I don't, I'm not
using it in any way.

The error I get is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)

So my questions are, why does the production site generates the
App_Data folder and why does the site looks for SQL Server 2005?

ThanksHi Hugo,

Is there anything in your web.config or in your code that uses Profiles,
Roles, or Membership? ASP.NET will try to create the ASPNETDB.mdf database
for you when it encounters code that requires it. That database goes into
the App_Data folder.

http://msdn2.microsoft.com/en-us/li...membership.aspx
Ken
Microsoft MVP [ASP.NET]

"Hugo Flores" <hugo.flores@.ge.comwrote in message
news:1156296556.478687.77100@.m79g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

>I created a Web Application Project in VS 2005.
The site is working fine in the development computer.
Then I transfer all my files and dll to the production computer.
I have a login form. If I try to log in, the production computer
automatically generates an App_Data folder (the development computer
doesn't have this folder at all) and it also generates an error saying
that I don't have SQL Server 2005, which of course I don't, I'm not
using it in any way.
>
The error I get is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)
>
So my questions are, why does the production site generates the
App_Data folder and why does the site looks for SQL Server 2005?
>
Thanks
>


No, I'm not using profiles at all, nothing on my web.config that has
anything to do with that.
Now, I've also checked that this only happens if my login fails.
I also have the new Login control, would that be causing the problem?
Do you think if I remove the Login control and use my own login form,
would solve the problem?

Ken Cox [Microsoft MVP] wrote:

Quote:

Originally Posted by

Hi Hugo,
>
Is there anything in your web.config or in your code that uses Profiles,
Roles, or Membership? ASP.NET will try to create the ASPNETDB.mdf database
for you when it encounters code that requires it. That database goes into
the App_Data folder.
>
http://msdn2.microsoft.com/en-us/li...membership.aspx
>
Ken
Microsoft MVP [ASP.NET]
>
"Hugo Flores" <hugo.flores@.ge.comwrote in message
news:1156296556.478687.77100@.m79g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

I created a Web Application Project in VS 2005.
The site is working fine in the development computer.
Then I transfer all my files and dll to the production computer.
I have a login form. If I try to log in, the production computer
automatically generates an App_Data folder (the development computer
doesn't have this folder at all) and it also generates an error saying
that I don't have SQL Server 2005, which of course I don't, I'm not
using it in any way.

The error I get is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)

So my questions are, why does the production site generates the
App_Data folder and why does the site looks for SQL Server 2005?

Thanks


Hi Hugo,

Yes, the Login control is almost certainly causing ASP.NET to implement the
Membership system:

"If you use login controls, they will automatically use the membership
system to validate a user."

http://msdn2.microsoft.com/en-us/library/yh26yfzy.aspx
Try implementing your own and see what happens?

Ken
Microsoft MVP [ASP.NET]

"Hugo Flores" <hugo.flores@.ge.comwrote in message
news:1156302779.713734.286680@.p79g2000cwp.googlegr oups.com...

Quote:

Originally Posted by

No, I'm not using profiles at all, nothing on my web.config that has
anything to do with that.
Now, I've also checked that this only happens if my login fails.
I also have the new Login control, would that be causing the problem?
Do you think if I remove the Login control and use my own login form,
would solve the problem?
>
>
Ken Cox [Microsoft MVP] wrote:

Quote:

Originally Posted by

>Hi Hugo,
>>
>Is there anything in your web.config or in your code that uses Profiles,
>Roles, or Membership? ASP.NET will try to create the ASPNETDB.mdf
>database
>for you when it encounters code that requires it. That database goes into
>the App_Data folder.
>>
>http://msdn2.microsoft.com/en-us/li...membership.aspx
>>
>Ken
>Microsoft MVP [ASP.NET]
>>
>"Hugo Flores" <hugo.flores@.ge.comwrote in message
>news:1156296556.478687.77100@.m79g2000cwm.googlegro ups.com...

Quote:

Originally Posted by

>I created a Web Application Project in VS 2005.
The site is working fine in the development computer.
Then I transfer all my files and dll to the production computer.
I have a login form. If I try to log in, the production computer
automatically generates an App_Data folder (the development computer
doesn't have this folder at all) and it also generates an error saying
that I don't have SQL Server 2005, which of course I don't, I'm not
using it in any way.
>
The error I get is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)
>
So my questions are, why does the production site generates the
App_Data folder and why does the site looks for SQL Server 2005?
>
Thanks
>


>


Yep,

Implementing my own login, solved the problem, thank you very much

Ken Cox [Microsoft MVP] wrote:

Quote:

Originally Posted by

Hi Hugo,
>
Yes, the Login control is almost certainly causing ASP.NET to implement the
Membership system:
>
"If you use login controls, they will automatically use the membership
system to validate a user."
>
http://msdn2.microsoft.com/en-us/library/yh26yfzy.aspx
>
Try implementing your own and see what happens?
>
Ken
Microsoft MVP [ASP.NET]
>
"Hugo Flores" <hugo.flores@.ge.comwrote in message
news:1156302779.713734.286680@.p79g2000cwp.googlegr oups.com...

Quote:

Originally Posted by

No, I'm not using profiles at all, nothing on my web.config that has
anything to do with that.
Now, I've also checked that this only happens if my login fails.
I also have the new Login control, would that be causing the problem?
Do you think if I remove the Login control and use my own login form,
would solve the problem?

Ken Cox [Microsoft MVP] wrote:

Quote:

Originally Posted by

Hi Hugo,
>
Is there anything in your web.config or in your code that uses Profiles,
Roles, or Membership? ASP.NET will try to create the ASPNETDB.mdf
database
for you when it encounters code that requires it. That database goes into
the App_Data folder.
>
http://msdn2.microsoft.com/en-us/li...membership.aspx
>
Ken
Microsoft MVP [ASP.NET]
>
"Hugo Flores" <hugo.flores@.ge.comwrote in message
news:1156296556.478687.77100@.m79g2000cwm.googlegro ups.com...
I created a Web Application Project in VS 2005.
The site is working fine in the development computer.
Then I transfer all my files and dll to the production computer.
I have a login form. If I try to log in, the production computer
automatically generates an App_Data folder (the development computer
doesn't have this folder at all) and it also generates an error saying
that I don't have SQL Server 2005, which of course I don't, I'm not
using it in any way.

The error I get is:
An error has occurred while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the
fact that under the default settings SQL Server does not allow remote
connections. (provider: SQL Network Interfaces, error: 26 - Error
Locating Server/Instance Specified)

So my questions are, why does the production site generates the
App_Data folder and why does the site looks for SQL Server 2005?

Thanks


Why is no one answering my queries..

Hi,

I have a datalist control and within the Itemplate I
have a radiobuttonlist control . I am binding data to the
datalist control in Page_load . Also I have sqldatareader
object that needs to be binded to the radiobutton list. I
am not able to bind the datareader to the radiobuttonlist
control as it is within the Itemtemplate. I am new
to .Net. Could someone please let me know what I should be
doing to bind the data to the radiobuttonlist within the
Itemtemplate.
When I try binding it, I get the following error:

System.NullReferenceException: Object reference not set to
an instance of an object.

Thanks..ani wrote:
> Hi,
>
> I have a datalist control and within the Itemplate I
> have a radiobuttonlist control . I am binding data to the
> datalist control in Page_load . Also I have sqldatareader
> object that needs to be binded to the radiobutton list. I
> am not able to bind the datareader to the radiobuttonlist
> control as it is within the Itemtemplate. I am new
> to .Net. Could someone please let me know what I should be
> doing to bind the data to the radiobuttonlist within the
> Itemtemplate.
> When I try binding it, I get the following error:
> System.NullReferenceException: Object reference not set to
> an instance of an object.
> Thanks..

You can do so by adding an event handler for the ItemDataBound event.
In that event, you can reference the e.Item and e.Item.DataItem...you
have to find your control in the item template, so you do a

((DataRow)e.Item.DataItem).FindControl("yourctlname")

I believe...note the dataitem is cast to a DataRow as I assumed I bound
my datalist to a DataTable. Then cast this whole expression to the type
of control you are using...

Note this assumes the control you're looking for is not inside another
naming container in the template...

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Why is MyControl.ToolTip In a <span> Tag?

I'm trying to set the title attribute on a CheckBox and I'm having some
issues in ASP.NET 1.1.
The title attribute in the following example is valid in HTML 4.01
Transitional:
<input id="MyCheckBox" type="checkbox" title="ToolTip">
However, ASP.NET doesn't like it. No matter what I do, ASP.NET places
my control inside of a span tag with the title attribute set in the
span, instead:
<span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span>
I've tried Setting the title in HTML, setting the ToolTip property of
the CheckBox, as well as attempting to use the
MyCheckBox.Attributes.Add("title", "ToolTip") method.
All of them have resulted in the same HTML output.
What's going on?
Thank you in advance,
Seanthe checkbox is an abstracted control. like most of the asp.net control, it
generates a span to contain any of the internal rendered html. if you add
attributes, they are applied to the span. type the html control version if
you need this level of control. in version 2.0, tooltip support has benn
added.
-- bruce (sqlwork.com)
"Fao, Sean" <enceladus311@.yahoo.comI-WANT-NO-SPAM> wrote in message
news:%234L%23%23MrIGHA.1288@.TK2MSFTNGP09.phx.gbl...
> I'm trying to set the title attribute on a CheckBox and I'm having some
> issues in ASP.NET 1.1.
> The title attribute in the following example is valid in HTML 4.01
> Transitional:
> <input id="MyCheckBox" type="checkbox" title="ToolTip">
> However, ASP.NET doesn't like it. No matter what I do, ASP.NET places my
> control inside of a span tag with the title attribute set in the span,
> instead:
> <span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span>
> I've tried Setting the title in HTML, setting the ToolTip property of the
> CheckBox, as well as attempting to use the
> MyCheckBox.Attributes.Add("title", "ToolTip") method.
> All of them have resulted in the same HTML output.
> What's going on?
> Thank you in advance,
> --
> Sean

Why is MyControl.ToolTip In a <span> Tag?

I'm trying to set the title attribute on a CheckBox and I'm having some
issues in ASP.NET 1.1.

The title attribute in the following example is valid in HTML 4.01
Transitional:

<input id="MyCheckBox" type="checkbox" title="ToolTip"
However, ASP.NET doesn't like it. No matter what I do, ASP.NET places
my control inside of a span tag with the title attribute set in the
span, instead:

<span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span
I've tried Setting the title in HTML, setting the ToolTip property of
the CheckBox, as well as attempting to use the
MyCheckBox.Attributes.Add("title", "ToolTip") method.

All of them have resulted in the same HTML output.

What's going on?

Thank you in advance,

--
Seanthe checkbox is an abstracted control. like most of the asp.net control, it
generates a span to contain any of the internal rendered html. if you add
attributes, they are applied to the span. type the html control version if
you need this level of control. in version 2.0, tooltip support has benn
added.

-- bruce (sqlwork.com)

"Fao, Sean" <enceladus311@.yahoo.comI-WANT-NO-SPAM> wrote in message
news:%234L%23%23MrIGHA.1288@.TK2MSFTNGP09.phx.gbl.. .
> I'm trying to set the title attribute on a CheckBox and I'm having some
> issues in ASP.NET 1.1.
> The title attribute in the following example is valid in HTML 4.01
> Transitional:
> <input id="MyCheckBox" type="checkbox" title="ToolTip">
> However, ASP.NET doesn't like it. No matter what I do, ASP.NET places my
> control inside of a span tag with the title attribute set in the span,
> instead:
> <span title="ToolTip"><input id="MyCheckBox" type="checkbox"></span>
> I've tried Setting the title in HTML, setting the ToolTip property of the
> CheckBox, as well as attempting to use the
> MyCheckBox.Attributes.Add("title", "ToolTip") method.
> All of them have resulted in the same HTML output.
> What's going on?
> Thank you in advance,
> --
> Sean

why is the color not rendered in Word?

underprocessableHi Dave,
Just a quick look at this, but it appears that you've defined single cell ta
ble rows with multiple (layered) colors as 'backgrounds'
for each cell and no cell content. Word doesn't really know how to do partia
l cell color fills for background, so what you're seeing
is the table background 'shading'.
Ifyou work from the other direction to build the table in Word using the tab
le tools, you'll note that the shading (background)
choices available are for selections at the levels of
Table
Cell
Paragraph
Text
Using File=>Web Page Preview then View source in the browser will give you
the structure of the Word table). You'll note that Word
cut out the inline-block coding you had when it opened your table, basing th
ings on its own internal 'Table Normal' base style.
A couple of ways to work this might be to divide the row into multiple, bord
erless cells (colums) for the width of the data you're
looking to represent and color/fill each cell, or you could keep the single
column/cell rows and fill with the appropriate count of
non-break spaces and apply shading to the text, or even place a colored shap
e in the table of the right width. Shaded text will
usually overlay the table background colors.
============
<<"Dave" <sdsds@.qdq.qdq> wrote in message news:%23j4Eg3cjHHA.3940@.TK2MSFTNGP
02.phx.gbl...
Hi,
i don't know whether it's a Word problem or asp.net problem. So i post it in
both.
I have an asp.net application which produces a html page (see attachment)
with a table containing a gray background colour and another background
colour (red) above this with variable length, representing a value. I pasted
it from IE to here below, but just like in Word, the red colour is not
rendered.
In the attachment, you can see as it is rendered in IE (with the red
colour).
The code of that html page is:
<table align="Center" border="0" style="border-width:0px;">
<tr><th
style="font-family:verdana;font-size:6pt;width:100px;">______100%______</th>
</tr>
<tr><td align="left" style="background-color:LightSlateGray;"><span
style="display:inline-block;background-color:Red;width:15px;"></span></td></
tr>
</table>
______100%______
My question is: is there any way to render this table in Word as it's
rendered in IE (with red colour)? Maybe by changing something in the code
...?
Thanks for help
Dave >>
--
Bob Buckland ?:-)
MS Office System Products MVP
*Courtesy is not expensive and can pay big dividends*
Thanks Bob
"Bob Buckland ?:-)" <75214.226(At Beautiful Downtown)compuserve.com> schreef
in bericht news:eLONHnkjHHA.3928@.TK2MSFTNGP03.phx.gbl...
> Hi Dave,
> Just a quick look at this, but it appears that you've defined single cell
> table rows with multiple (layered) colors as 'backgrounds'
> for each cell and no cell content. Word doesn't really know how to do
> partial cell color fills for background, so what you're seeing
> is the table background 'shading'.
> Ifyou work from the other direction to build the table in Word using the
> table tools, you'll note that the shading (background)
> choices available are for selections at the levels of
> Table
> Cell
> Paragraph
> Text
> Using File=>Web Page Preview then View source in the browser will give
> you the structure of the Word table). You'll note that Word
> cut out the inline-block coding you had when it opened your table, basing
> things on its own internal 'Table Normal' base style.
> A couple of ways to work this might be to divide the row into multiple,
> borderless cells (colums) for the width of the data you're
> looking to represent and color/fill each cell, or you could keep the
> single column/cell rows and fill with the appropriate count of
> non-break spaces and apply shading to the text, or even place a colored
> shape in the table of the right width. Shaded text will
> usually overlay the table background colors.
> ============
> <<"Dave" <sdsds@.qdq.qdq> wrote in message
> news:%23j4Eg3cjHHA.3940@.TK2MSFTNGP02.phx.gbl...
> Hi,
> i don't know whether it's a Word problem or asp.net problem. So i post it
> in
> both.
> I have an asp.net application which produces a html page (see attachment)
> with a table containing a gray background colour and another background
> colour (red) above this with variable length, representing a value. I
> pasted
> it from IE to here below, but just like in Word, the red colour is not
> rendered.
> In the attachment, you can see as it is rendered in IE (with the red
> colour).
> The code of that html page is:
> <table align="Center" border="0" style="border-width:0px;">
> <tr><th
> style="font-family:verdana;font-size:6pt;width:100px;">______100%______</t
h></tr>
> <tr><td align="left" style="background-color:LightSlateGray;"><span
> style="display:inline-block;background-color:Red;width:15px;"></span></td>
</tr>
> </table>
> ______100%______
>
> My question is: is there any way to render this table in Word as it's
> rendered in IE (with red colour)? Maybe by changing something in the code
> ...?
> Thanks for help
> Dave >>
> --
> Bob Buckland ?:-)
> MS Office System Products MVP
> *Courtesy is not expensive and can pay big dividends*
>

Why is the img src= part of the image link removed from database?

My database contains a field with a link to an image. The second part of the link is mysteriously removed when pasted into the database. This field is nVarChar(200). I am using MS SQL Server Management Studio Express to connect and edit the SQL Server 05 database on the server.

Why is the last part of the link being removed, and how can I fix it?

Before:
<a href="http://links.10026.com/?link=http://www.domain.net/click-1234-5678" target="_top" >
<img src="http://pics.10026.com/?src=http://www.domain2.com/image-987-6543" width="120" height="60" alt="" border="0"></a>

After Pasting:
<a href="http://links.10026.com/?link=http://www.domain.net/click-1234-5678" target="_top" >

Thanks for your help and time.

I figured out the problem. I just needed to remove the extra space.


try putting it all on one line.. It's probably the line break.

Why is the runat=server not default?

Hello All,

While developing an asp.net application, I realized that the
runat='server attribute is not default for the asp.net server controls.
I have to explicitly put it everytime against each control.

Why is this the case? shouldn't the runat='server' be default?

regards,
Abhishek.I assume you are talking about cases where you are in HTML view and typing
in the tags yourself because if you were using the design mode and "drawing"
the controls, runat=server is automatically placed in the code for you.

When you are in HTML mode, you will get intelliSense help with closing tags
and attribute lists but it's not going to assume anything about the values
of those attributes. I agree that it would be nice (since I can't imaging
having a server control that doesn't runat the server!), but the HTML view
is just not setup that way.

"Abhishek Srivastava" <abhishek-srivastava@.nospam.net> wrote in message
news:OFw%234V57DHA.2044@.TK2MSFTNGP10.phx.gbl...
> Hello All,
> While developing an asp.net application, I realized that the
> runat='server attribute is not default for the asp.net server controls.
> I have to explicitly put it everytime against each control.
> Why is this the case? shouldn't the runat='server' be default?
> regards,
> Abhishek.
Scott,

You are right. However, there should be a base class for all server
controls which should assume the value of this attribute as server (if
nothing else is specified). So that programmers or IDEs don't have to
repeatedly specify this.

For notepad programmers it is convienient. and for IDEs it is less code
bloat.

regards,
Abhishek.

Scott M. wrote:
> I assume you are talking about cases where you are in HTML view and typing
> in the tags yourself because if you were using the design mode and "drawing"
> the controls, runat=server is automatically placed in the code for you.
> When you are in HTML mode, you will get intelliSense help with closing tags
> and attribute lists but it's not going to assume anything about the values
> of those attributes. I agree that it would be nice (since I can't imaging
> having a server control that doesn't runat the server!), but the HTML view
> is just not setup that way.
>
> "Abhishek Srivastava" <abhishek-srivastava@.nospam.net> wrote in message
> news:OFw%234V57DHA.2044@.TK2MSFTNGP10.phx.gbl...
>>Hello All,
>>
>>While developing an asp.net application, I realized that the
>>runat='server attribute is not default for the asp.net server controls.
>>I have to explicitly put it everytime against each control.
>>
>>Why is this the case? shouldn't the runat='server' be default?
>>
>>regards,
>>Abhishek.
>
I agree 100%. It's just that the HTML editor in VS.NET isn't much more than
a glorified FrontPage editor (in fact, in some ways FrontPage is better).

"Abhishek Srivastava" <abhishek-srivastava@.nospam.net> wrote in message
news:OOdlVK77DHA.2952@.TK2MSFTNGP09.phx.gbl...
> Scott,
> You are right. However, there should be a base class for all server
> controls which should assume the value of this attribute as server (if
> nothing else is specified). So that programmers or IDEs don't have to
> repeatedly specify this.
> For notepad programmers it is convienient. and for IDEs it is less code
> bloat.
> regards,
> Abhishek.
> Scott M. wrote:
> > I assume you are talking about cases where you are in HTML view and
typing
> > in the tags yourself because if you were using the design mode and
"drawing"
> > the controls, runat=server is automatically placed in the code for you.
> > When you are in HTML mode, you will get intelliSense help with closing
tags
> > and attribute lists but it's not going to assume anything about the
values
> > of those attributes. I agree that it would be nice (since I can't
imaging
> > having a server control that doesn't runat the server!), but the HTML
view
> > is just not setup that way.
> > "Abhishek Srivastava" <abhishek-srivastava@.nospam.net> wrote in message
> > news:OFw%234V57DHA.2044@.TK2MSFTNGP10.phx.gbl...
> >>Hello All,
> >>
> >>While developing an asp.net application, I realized that the
> >>runat='server attribute is not default for the asp.net server controls.
> >>I have to explicitly put it everytime against each control.
> >>
> >>Why is this the case? shouldn't the runat='server' be default?
> >>
> >>regards,
> >>Abhishek.
use the design view to create all your controls, then use code view to move
them around and do all the 'real' work

R

"Abhishek Srivastava" <abhishek-srivastava@.nospam.net> wrote in message
news:OFw%234V57DHA.2044@.TK2MSFTNGP10.phx.gbl...
> Hello All,
> While developing an asp.net application, I realized that the
> runat='server attribute is not default for the asp.net server controls.
> I have to explicitly put it everytime against each control.
> Why is this the case? shouldn't the runat='server' be default?
> regards,
> Abhishek.

Why is the repeater empty in a postback?

Hello,
I have a form that contains a repeater. A simplified version of the
ItemTemplate is shown below (air code)...
<br><asp:Literal id="litID" runat="server" />
<br><asp:TextBox id="txtQty" runat="server" />
<hr>
This basically shows a list of item IDs, with quantities for each one.
The quantity is in a text box so the user can change it. I set the Text
properties in the ItemDataBound event.
When the page is posted back, I want to go through the repeater and
update a database based on the info in it. After that, I will bind the
repeater to the database data and have the new info displayed.
The problem is that the repeater does not contain any items on postback.
I tried looping through the Items collection, but it's empty. The tag
for the repeater looks like...
<asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
RunAt="Server">
so it's not that I've turned off the view state.
The one point that might be relevant here is that the repeater and its
code are inside a user control. Don't know if this makes any difference.
Any ideas? I know the info is there, as if I dump the form contents to
the page, I see form fields with names like
_ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
there. I don't see anything for the literals though.
Please help, I'm really stuck here. TIA
Alan Silver
(anything added below this line is nothing to do with me)you will have to do a FOR EACH item in the repeater's collection and use the
FindControl() call to capture the textbox to get the value.
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
"Alan Silver" wrote:

> Hello,
> I have a form that contains a repeater. A simplified version of the
> ItemTemplate is shown below (air code)...
> <br><asp:Literal id="litID" runat="server" />
> <br><asp:TextBox id="txtQty" runat="server" />
> <hr>
> This basically shows a list of item IDs, with quantities for each one.
> The quantity is in a text box so the user can change it. I set the Text
> properties in the ItemDataBound event.
> When the page is posted back, I want to go through the repeater and
> update a database based on the info in it. After that, I will bind the
> repeater to the database data and have the new info displayed.
> The problem is that the repeater does not contain any items on postback.
> I tried looping through the Items collection, but it's empty. The tag
> for the repeater looks like...
> <asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
> RunAt="Server">
> so it's not that I've turned off the view state.
> The one point that might be relevant here is that the repeater and its
> code are inside a user control. Don't know if this makes any difference.
> Any ideas? I know the info is there, as if I dump the form contents to
> the page, I see form fields with names like
> _ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
> there. I don't see anything for the literals though.
> Please help, I'm really stuck here. TIA
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>you will have to do a FOR EACH item in the repeater's collection and use the
>FindControl() call to capture the textbox to get the value.
That's what I did, but as I explained, the repeater's collection was
empty. I have done this sort of thing many times before without problem,
I just wonder if it was the fact that the repeater was in a user control
that made this different.
Any idea? TIA
Alan Silver
(anything added below this line is nothing to do with me)

Why is the repeater empty in a postback?

Hello,

I have a form that contains a repeater. A simplified version of the
ItemTemplate is shown below (air code)...

<br><asp:Literal id="litID" runat="server" />
<br><asp:TextBox id="txtQty" runat="server" />
<hr
This basically shows a list of item IDs, with quantities for each one.
The quantity is in a text box so the user can change it. I set the Text
properties in the ItemDataBound event.

When the page is posted back, I want to go through the repeater and
update a database based on the info in it. After that, I will bind the
repeater to the database data and have the new info displayed.

The problem is that the repeater does not contain any items on postback.
I tried looping through the Items collection, but it's empty. The tag
for the repeater looks like...

<asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
RunAt="Server"
so it's not that I've turned off the view state.

The one point that might be relevant here is that the repeater and its
code are inside a user control. Don't know if this makes any difference.

Any ideas? I know the info is there, as if I dump the form contents to
the page, I see form fields with names like
_ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
there. I don't see anything for the literals though.

Please help, I'm really stuck here. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)you will have to do a FOR EACH item in the repeater's collection and use the
FindControl() call to capture the textbox to get the value.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Alan Silver" wrote:

> Hello,
> I have a form that contains a repeater. A simplified version of the
> ItemTemplate is shown below (air code)...
> <br><asp:Literal id="litID" runat="server" />
> <br><asp:TextBox id="txtQty" runat="server" />
> <hr>
> This basically shows a list of item IDs, with quantities for each one.
> The quantity is in a text box so the user can change it. I set the Text
> properties in the ItemDataBound event.
> When the page is posted back, I want to go through the repeater and
> update a database based on the info in it. After that, I will bind the
> repeater to the database data and have the new info displayed.
> The problem is that the repeater does not contain any items on postback.
> I tried looping through the Items collection, but it's empty. The tag
> for the repeater looks like...
> <asp:Repeater ID="rptBasket" OnItemDataBound="rptBasket_ItemDataBound"
> RunAt="Server">
> so it's not that I've turned off the view state.
> The one point that might be relevant here is that the repeater and its
> code are inside a user control. Don't know if this makes any difference.
> Any ideas? I know the info is there, as if I dump the form contents to
> the page, I see form fields with names like
> _ctl3:rptBasket:_ctl2:txtQuantity which shows the textbox values are
> there. I don't see anything for the literals though.
> Please help, I'm really stuck here. TIA
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>you will have to do a FOR EACH item in the repeater's collection and use the
>FindControl() call to capture the textbox to get the value.

That's what I did, but as I explained, the repeater's collection was
empty. I have done this sort of thing many times before without problem,
I just wonder if it was the fact that the repeater was in a user control
that made this different.

Any idea? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

why is the selectedvalue of this dropdownlist empty?

Hi,
This code sends back the selectedvalue of a dropdownlist to itself
(postabck).
But the value (dd in the code) is empty.
I must say: it works with EnableViewState="true".
My question is: dropdownlist control doesn't need viewstate for keeping the
value when the ListItems are put declaratively. Why not when the ListItems
are put programmatically?
Thanks
Bartif a select is declared declaratively, on postback the item values are
set in oninit by the code the form generates.
if you dynamically update the list, you need to also do it in oninit of
the postback.
if viewstate is enabled, the list is stored in viewstate, and the
control reloades the list in onviewstate load. also the render value is
saved, so the onchange event can be fired.
-- bruce (sqlwork.com)
Bart wrote:
> Hi,
> This code sends back the selectedvalue of a dropdownlist to itself
> (postabck).
> But the value (dd in the code) is empty.
> I must say: it works with EnableViewState="true".
> My question is: dropdownlist control doesn't need viewstate for keeping th
e
> value when the ListItems are put declaratively. Why not when the ListItems
> are put programmatically?
> Thanks
> Bart
>
If you put them in programmatically, in the page load, it reloads every time
the page posts back
You must surround the loading of the ddl with an postback block (if not
page.ispostback then...)
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com
"Bart" <b@.s> wrote in message
news:%23vzxrKioHHA.4196@.TK2MSFTNGP06.phx.gbl...
> Hi,
> This code sends back the selectedvalue of a dropdownlist to itself
> (postabck).
> But the value (dd in the code) is empty.
> I must say: it works with EnableViewState="true".
> My question is: dropdownlist control doesn't need viewstate for keeping
> the value when the ListItems are put declaratively. Why not when the
> ListItems are put programmatically?
> Thanks
> Bart
>
Thanks to both
"David Wier" <davidwier@.davidwier.nospam.com> schreef in bericht
news:epMuOPjoHHA.3880@.TK2MSFTNGP04.phx.gbl...
> If you put them in programmatically, in the page load, it reloads every
> time the page posts back
> You must surround the loading of the ddl with an postback block (if not
> page.ispostback then...)
> --
> David Wier
> MVP/ASPInsider
> http://aspnet101.com
> http://iWritePro.com
>
> "Bart" <b@.s> wrote in message
> news:%23vzxrKioHHA.4196@.TK2MSFTNGP06.phx.gbl...
>

why is the selectedvalue of this dropdownlist empty?

Hi,

This code sends back the selectedvalue of a dropdownlist to itself
(postabck).
But the value (dd in the code) is empty.
I must say: it works with EnableViewState="true".

My question is: dropdownlist control doesn't need viewstate for keeping the
value when the ListItems are put declaratively. Why not when the ListItems
are put programmatically?

Thanks
Bartif a select is declared declaratively, on postback the item values are
set in oninit by the code the form generates.

if you dynamically update the list, you need to also do it in oninit of
the postback.

if viewstate is enabled, the list is stored in viewstate, and the
control reloades the list in onviewstate load. also the render value is
saved, so the onchange event can be fired.

-- bruce (sqlwork.com)

Bart wrote:

Quote:

Originally Posted by

Hi,
>
This code sends back the selectedvalue of a dropdownlist to itself
(postabck).
But the value (dd in the code) is empty.
I must say: it works with EnableViewState="true".
>
My question is: dropdownlist control doesn't need viewstate for keeping the
value when the ListItems are put declaratively. Why not when the ListItems
are put programmatically?
>
Thanks
Bart
>
>


If you put them in programmatically, in the page load, it reloads every time
the page posts back
You must surround the loading of the ddl with an postback block (if not
page.ispostback then...)

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com
"Bart" <b@.swrote in message
news:%23vzxrKioHHA.4196@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Hi,
>
This code sends back the selectedvalue of a dropdownlist to itself
(postabck).
But the value (dd in the code) is empty.
I must say: it works with EnableViewState="true".
>
My question is: dropdownlist control doesn't need viewstate for keeping
the value when the ListItems are put declaratively. Why not when the
ListItems are put programmatically?
>
Thanks
Bart
>


Thanks to both

"David Wier" <davidwier@.davidwier.nospam.comschreef in bericht
news:epMuOPjoHHA.3880@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

If you put them in programmatically, in the page load, it reloads every
time the page posts back
You must surround the loading of the ddl with an postback block (if not
page.ispostback then...)
>
--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://iWritePro.com
>
>
>
"Bart" <b@.swrote in message
news:%23vzxrKioHHA.4196@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

>Hi,
>>
>This code sends back the selectedvalue of a dropdownlist to itself
>(postabck).
>But the value (dd in the code) is empty.
>I must say: it works with EnableViewState="true".
>>
>My question is: dropdownlist control doesn't need viewstate for keeping
>the value when the ListItems are put declaratively. Why not when the
>ListItems are put programmatically?
>>
>Thanks
>Bart
>>


>
>

Why is there a ASP.NET account on my computer?

Why is there a ASP.NET account on my computer? I went into user accounts in WinXP Pro and saw an account I did not create called "ASP.NET Machine A..." why was this there? I deleted itProbably because you installed the .NET framework from Windows Update. If you don't have an ASP.NET server on this machine, it is safe to delete it.
It is a very low-priviledged account anyway.

Why is the Text property missing?

I'm sure that I'm missing something blindingly obvious here, but.....

Can anyone tell me why certain properties are missing while editing controls/setting their properties in the HTML pane of the ASPX file in the VS IDE? The most basic example would be the TextBox. A typical declaration would be something like this:

<asp:TextBox ID="txtTest" Runat=server></asp:TextBox
OK, so now I want to bind my textbox to something. The way I would normally go about doing this would be like this:

<asp:TextBox ID="txtTest" Runat=server Text='<%# SomePropertyOnMyForm %>' ></asp:TextBox
This is fine. BUT the Text property does not show up in the VS IDE while I'm in HTML pane of the ASPX. If I swtich to the Design pane of the ASPX and look at the property sheet for my TextBox, the Text property is there! This is not the only property that is "missing" while editing in the HTML pane of the ASPX file.

Has anyone else had this problem? Does anyone know what is going on and why? I've searched loads of forums for an answer and can't find anything on the subject!

Any replies gratefully received,

Steve Camsell
steve.camsell@dotnet.itags.org.mmgroup.co.ukIn the ASP.NET document model, the Text property renders as a child node of the asp:TextBox element, rather than an attribute.
i.e.:

<asp:TextBox ID="txtTest" Runat=server><%# SomePropertyOnMyForm %></asp:TextBox>

Hmmm... if I create a new blank page and add the following as you suggest:

<asp:TextBox ID="txtTest" Runat="server"> <%# myName %> </asp:TextBox
I get a compile time error : "TextBox cannot have child of type 'DesignerDataBoundLiteralControl'"

If however, I change it as follows:

<asp:TextBox ID="txtTest" Runat="server" Text='<%# myName %>'></asp:TextBox
It works perfectly.

Why is there no "runtime" allowed in the ASP.NET web.config

I would like my ASP.NET apps to pick up there associated assembly references
at runtime but I do not see a runtime tag in the web.config schema, or am I
wrong?
PatrickI'm not sure I understand why you need this functionality, aren't assembly
references imported into your application at compile time? If i missed the
mark, please let me know...
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @. http://www.lulu.com/owc
----
"inetmug" <inetmug@.discussions.microsoft.com> wrote in message
news:DA541202-B25F-4BB1-8B2A-7C6FCDC91A49@.microsoft.com...
>I would like my ASP.NET apps to pick up there associated assembly
>references
> at runtime but I do not see a runtime tag in the web.config schema, or am
> I
> wrong?
>
> --
> Patrick
Are you looking for the compilation element?
<configuration>
<compilation>
<assemblies>
<add assembly="System.Data, Version=1.0.2411.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
</assemblies>
</compilation>
</configuration>
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 11 Feb 2005 14:03:01 -0800, "inetmug"
<inetmug@.discussions.microsoft.com> wrote:

>I would like my ASP.NET apps to pick up there associated assembly reference
s
>at runtime but I do not see a runtime tag in the web.config schema, or am I
>wrong?
Yes, references are there via the project at compile time. However, my
question is more focused on deployment and runtime.
I would like to direct my assembly references at runtime for referenced
components. This is in addition to the compilation tag. The compilation
tag, if I understand this correctly, is there to direct the compilation of
pages when they are first accessed.
There is a "runtime" available in a normal app.config, but unless I am
missiing something this tag is not included in the web.config schema.
"Alvin Bruney [MVP]" wrote:

> I'm not sure I understand why you need this functionality, aren't assembly
> references imported into your application at compile time? If i missed the
> mark, please let me know...
> --
> Regards,
> Alvin Bruney [MVP ASP.NET]
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @. http://www.lulu.com/owc
> ----
>
> "inetmug" <inetmug@.discussions.microsoft.com> wrote in message
> news:DA541202-B25F-4BB1-8B2A-7C6FCDC91A49@.microsoft.com...
>
>
Scott, see my previous reply to Alvin. This is not the same tag...
"Scott Allen" wrote:

> Are you looking for the compilation element?
> <configuration>
> <compilation>
> <assemblies>
> <add assembly="System.Data, Version=1.0.2411.0,
> Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> </assemblies>
> </compilation>
> </configuration>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
> On Fri, 11 Feb 2005 14:03:01 -0800, "inetmug"
> <inetmug@.discussions.microsoft.com> wrote:
>
>
You can also add a runtime element - it is not in the system.web
schema but it is in the outer configuration schema. See:
http://www.hanselman.com/blog/Perma...be.
aspx
for an example.
Scott
http://www.OdeToCode.com/blogs/scott/
On Mon, 14 Feb 2005 06:37:06 -0800, "inetmug"
<inetmug@.discussions.microsoft.com> wrote:
>Scott, see my previous reply to Alvin. This is not the same tag...
>"Scott Allen" wrote:
>

Why is there no "runtime" allowed in the ASP.NET web.config

I would like my ASP.NET apps to pick up there associated assembly references
at runtime but I do not see a runtime tag in the web.config schema, or am I
wrong?

--
PatrickI'm not sure I understand why you need this functionality, aren't assembly
references imported into your application at compile time? If i missed the
mark, please let me know...

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @. http://www.lulu.com/owc
------------------

"inetmug" <inetmug@.discussions.microsoft.com> wrote in message
news:DA541202-B25F-4BB1-8B2A-7C6FCDC91A49@.microsoft.com...
>I would like my ASP.NET apps to pick up there associated assembly
>references
> at runtime but I do not see a runtime tag in the web.config schema, or am
> I
> wrong?
>
> --
> Patrick
Are you looking for the compilation element?

<configuration>
<compilation>
<assemblies>
<add assembly="System.Data, Version=1.0.2411.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
</assemblies>
</compilation>
</configuration
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 11 Feb 2005 14:03:01 -0800, "inetmug"
<inetmug@.discussions.microsoft.com> wrote:

>I would like my ASP.NET apps to pick up there associated assembly references
>at runtime but I do not see a runtime tag in the web.config schema, or am I
>wrong?
Yes, references are there via the project at compile time. However, my
question is more focused on deployment and runtime.

I would like to direct my assembly references at runtime for referenced
components. This is in addition to the compilation tag. The compilation
tag, if I understand this correctly, is there to direct the compilation of
pages when they are first accessed.

There is a "runtime" available in a normal app.config, but unless I am
missiing something this tag is not included in the web.config schema.

"Alvin Bruney [MVP]" wrote:

> I'm not sure I understand why you need this functionality, aren't assembly
> references imported into your application at compile time? If i missed the
> mark, please let me know...
> --
> Regards,
> Alvin Bruney [MVP ASP.NET]
> [Shameless Author plug]
> The Microsoft Office Web Components Black Book with .NET
> Now Available @. http://www.lulu.com/owc
> ------------------
>
> "inetmug" <inetmug@.discussions.microsoft.com> wrote in message
> news:DA541202-B25F-4BB1-8B2A-7C6FCDC91A49@.microsoft.com...
> >I would like my ASP.NET apps to pick up there associated assembly
> >references
> > at runtime but I do not see a runtime tag in the web.config schema, or am
> > I
> > wrong?
> > --
> > Patrick
>
Scott, see my previous reply to Alvin. This is not the same tag...

"Scott Allen" wrote:

> Are you looking for the compilation element?
> <configuration>
> <compilation>
> <assemblies>
> <add assembly="System.Data, Version=1.0.2411.0,
> Culture=neutral,
> PublicKeyToken=b77a5c561934e089"/>
> </assemblies>
> </compilation>
> </configuration>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
> On Fri, 11 Feb 2005 14:03:01 -0800, "inetmug"
> <inetmug@.discussions.microsoft.com> wrote:
> >I would like my ASP.NET apps to pick up there associated assembly references
> >at runtime but I do not see a runtime tag in the web.config schema, or am I
> >wrong?
>
You can also add a runtime element - it is not in the system.web
schema but it is in the outer configuration schema. See:
http://www.hanselman.com/blog/Perma...0432c98dbe.aspx
for an example.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 14 Feb 2005 06:37:06 -0800, "inetmug"
<inetmug@.discussions.microsoft.com> wrote:

>Scott, see my previous reply to Alvin. This is not the same tag...
>"Scott Allen" wrote:
>> Are you looking for the compilation element?
>>
>> <configuration>
>> <compilation>
>> <assemblies>
>> <add assembly="System.Data, Version=1.0.2411.0,
>> Culture=neutral,
>> PublicKeyToken=b77a5c561934e089"/>
>> </assemblies>
>> </compilation>
>> </configuration>
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Fri, 11 Feb 2005 14:03:01 -0800, "inetmug"
>> <inetmug@.discussions.microsoft.com> wrote:
>>
>> >I would like my ASP.NET apps to pick up there associated assembly references
>> >at runtime but I do not see a runtime tag in the web.config schema, or am I
>> >wrong?
>>
>

why is there a web.dll in my project?

Does anyone know why you get a web.dll in your project's bin directory, but not in others?Because that dll represents the compiled application which ussually goes into /bin directory.
Hmmmm... not so sure about that claim but thanks for the response. Maybe if I give a little
more info it would help.

I have a 4 project solution with 3 ASP.NET web applications and 1 class library.

One of the web projects has the web.dll and the other 2 haven't. This has been a
colloborative development so I'm not sure if a previous developer has delibarately added it or not.

Also, in previous single web project applications there has been no Web.dll in the bin
directory, only a .dll named according to the Project title.

I just want to satisfy my own curiosity. Hope to get some more responses.
You must also FTP this up to your webhost in order to make everything work, no one told me this in the beginning and I could never figure out why i would get errors, guess I read the wrong books :).
I was confused at why it was called web.dll.
I eventually figured that the previous developer had re-named the assembly for some reason using the properties of the project.

Why is there no Equals() or GetHashCode() in ArrayList?

Why doesnt ArrayList implements the Equals() or GetHashCode() methods?
How is the developer supposed to check if an array list is equal to
another array list? Is the developer supposed to iterate through the
array list to find out if they are equal or not? This should be handled
by the framework classes and I don't want to do any unnecessary
implementation (read copy-paste-problems).
If I look through the other classes in System.Collection I see that no
implements GetHashCode() or Equals(). If none of them do, then it must
be a design choice. But what design choice would that be? If anyone
have any explanation, please let me know.I really want to know.
There is an interface in System.Collections.Generic that is named
IEqualityComparer, which has two methods, Equals() and GetHashCode().
Why make an interface when every class implements those methods? And
why doesn't the default list/collection classes implement this
interface?
<flamebait-to-be-ignored>
If I look to Java, the ArrayList implements equals(), hashCode() as all
good objects should. They have also a good explanation on how it is
done here.
http://shorl.com/gogedrikekati
http://shorl.com/fygafrebrypeko
</flamebait-to-be-ignored>
Regards
http://redsolo.blogspot.comSorry for the double post into this group. This message was intended
for microsoft.public.dotnet.framework. Please reply to the message in
that group.
Sorry

Why is there no clear info on Dropdownlist in PropertyGrid so hard?

The simplicity of the example will explain itself. Code has been stripped down.

Private _itemID as string
Private _itemName as string
Private _itemType as string
Private _width as integer

Each private variable has its own simple property following standard same pattern:

<Category("Behavior"), Browsable(True)> _
Public Property ItemID() As Integer
Get
Return _item Set(ByVal Value As Integer)
_item = Value
End Set
End Property

The ItemID property will be bound to values from an XML file .When ItemID is changed, the other 3 properties will be automagically populated with the item's respective values from same XML file.

That's ALL I WANT!

Problems I've encountered:

1. Populating dropdownlist2. Firing event to trigger updating of the other properties.3. All the examples I find are in:-- VB.NET/ Windows forms which uses different objects in UITypeEditor-- Too complex to follow for ASP.NET webform-- Not In VB (not a biggie, but helpful if i can avoid symantical differences in a C# to VB conversion)

I am an ASP.NET/VB programmer just looking to have happy life.

Answers to some of you questions..

Regarding populating dropdownlist seehttp://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/dropdownlist.aspx

Regarding Firing of events could you not set the values of the other properties in the set part of your property accessor just after _itemID = value set the other properties.

I am assuming here you have all the mechanism to read data from your XML file.


To answer your questions: yeah I know how to bind dropdownllist from XML. My question was more where does this happen in control or the TypeEditor? Those othe properties should be editalbe, not ReadOnly, and yes, firing event won't be necessary. This posted code below was left out for simplicity. I hope it helps better explain my problem:

<Category("Behavior"), _
Browsable(True), _
Editor(GetType(MyDropDownListEditor), GetType(UITypeEditor))> _
Public Property ItemID() As String
Get
Return _itemID
End Get
Set(ByVal value As String)
_itemID = value
End Set
End Property

The UTITypeEditor code is provided

Public Class MyDropDownListEditor
Inherits System.Drawing.Design.UITypeEdit

Public Overrides Function GetEditStyle(ByVal context As _
ITypeDescriptorContext) As UITypeEditorEditStyle
Return UITypeEditorEditStyle.DropDown
End Function

Public Overloads Overrides _
Function EditValue(ByVal context As ITypeDescriptorContext, _
ByVal provider As IServiceProvider, _
ByVal value As Object) As Object

If context Is Nothing _
OrElse provider Is Nothing _
OrElse context.Instance Is Nothing Then
Return MyBase.EditValue(provider, value)
End If

Try
*** WHAT GOES HERE **
Where i.e. where do I fill the drop-down lslist

Catch ex As Exception
Throw New Exception("Error in EditValue Routine")
End Try
Return MyBase.EditValue(context, provider, value)
End Function EditValue

End Class

Why is there no intellisense for my Custom Web Server controls in HTML view !

Hello everyone...
I am new in creating custom web server controls. I am having one problem at
the moment and i have been looking all around and haven't found a solution.
Okay.. here it goes... the custom web server control derives from the
WebControl class. I have added a few more properties to my custom control.
Everything
is working fine. The issue is when I use the custom web server control in
the aspx page, there is no intellisense for the custom control in the "html
view" at all. There is intellisense for the custom control in the code
behind class file though. Also in the design view of the aspx page, the
custom control's property are displayed in the property sheet too. The only
issue I am having is with the "html view" and it is driving me crazy that
there is no intellisense for my custom control. I code alot in the html view
and not having intellisense for my custom controls are driving me crazy.
Can you guys tell me how is it possible to get the intellisense on my editor
for the properties in my custom control.

Thanks

JK.I know there's an extra step you have to go through which basically involves
making an .xsd file containing the information that will be used by the HTML
view's intellisense but I haven't actually done this yet myself. With luck
though, that will point you to the correct direction.

Hope tihs helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"JollyK" <JollyK@.email.com> wrote in message
news:OpgjEeXxDHA.2136@.TK2MSFTNGP10.phx.gbl...
> Hello everyone...
> I am new in creating custom web server controls. I am having one problem
at
> the moment and i have been looking all around and haven't found a
solution.
> Okay.. here it goes... the custom web server control derives from the
> WebControl class. I have added a few more properties to my custom control.
> Everything
> is working fine. The issue is when I use the custom web server control in
> the aspx page, there is no intellisense for the custom control in the
"html
> view" at all. There is intellisense for the custom control in the code
> behind class file though. Also in the design view of the aspx page, the
> custom control's property are displayed in the property sheet too. The
only
> issue I am having is with the "html view" and it is driving me crazy that
> there is no intellisense for my custom control. I code alot in the html
view
> and not having intellisense for my custom controls are driving me crazy.
> Can you guys tell me how is it possible to get the intellisense on my
editor
> for the properties in my custom control.
> Thanks
> JK.

Why is there no Equals() or GetHashCode() in ArrayList?

Why doesnt ArrayList implements the Equals() or GetHashCode() methods?
How is the developer supposed to check if an array list is equal to
another array list? Is the developer supposed to iterate through the
array list to find out if they are equal or not? This should be handled
by the framework classes and I don't want to do any unnecessary
implementation (read copy-paste-problems).

If I look through the other classes in System.Collection I see that no
implements GetHashCode() or Equals(). If none of them do, then it must
be a design choice. But what design choice would that be? If anyone
have any explanation, please let me know.I really want to know.

There is an interface in System.Collections.Generic that is named
IEqualityComparer, which has two methods, Equals() and GetHashCode().
Why make an interface when every class implements those methods? And
why doesn't the default list/collection classes implement this
interface?

<flamebait-to-be-ignored>
If I look to Java, the ArrayList implements equals(), hashCode() as all
good objects should. They have also a good explanation on how it is
done here.
http://shorl.com/gogedrikekati
http://shorl.com/fygafrebrypeko
</flamebait-to-be-ignored>

Regards
http://redsolo.blogspot.comSorry for the double post into this group. This message was intended
for microsoft.public.dotnet.framework. Please reply to the message in
that group.

Sorry

Why is there something called ViewState? Why do I need that hidden field?

All time working with ASP.NET I never really bothered about ViewState and how it works until today.

ViewState is cool and it works. It is stored as a hidden field inside the the form and posted back to the server. But for what reason is this information stored in a hidden field? Some people go about and write it to session, application, cache or even global static variables to get rid of it. My question is why do I need the ViewState variable/data itself?

Doesn't a page/form work like this?:

1.) I get my form which is empty at the beginning.

2.) I enter some data in there and do a postback via a button for instance.

3.) The page is reloaded with the values I entered automatically restored. ASP.NET has the values since they are posted via the form.

Why do it need to store them another time inside a hidden field? I just don't get it and have no idea why I would need that stuff in there. The data I need is posted and after posting I don't need what was in the fields the time before the post. I want the new values not the old ones. Or am I missing something?

Try this:http://msdn2.microsoft.com/en-us/library/ms972976.aspx

Hope that helps.

Aaron


The reason for view state is this: Say you fill out a form, submit it, and it displays a second page that says you have an error. If you click the back button and you have viewstate disabled, the fields are emtpy. If viewstate is enabled, the data is retained. It is a way of retaining the data on the client machine momentarily.

Hope this helps!


Nope that's not correct, it's got nothing to do with the back button - that's to do with your browsers own cached version of the page itself - it has nothing to do with Viewstate.

Here's a quick overview:

WhatViewState Isn't:

ViewState does not restore posted values to controls on a WebForm.
If you disable a control's ViewState, you will see that its value is still restored.

ViewState does not automatically recreate any controls that were dynamically created in the code.
Dynamically created controls on a page must be recreated when the page PostBack is processed.

ViewState is not for user or session data or for transferring data across pages.
Viewstate only can store data that is sent back to the same page during a PostBack operation.

ViewState does not hold "Controls".
Viewstate does not normally hold entire controls - only values and properties.

What ViewState is:

Viewstate represents thestate of the page when it was last processed on the server. ViewState is used to track and restore the state values of controls that would otherwise be lost, either because those valuesdo not post with the form or becausethey are not in the page html.A control defined solely in your page html with no changes made in thecode will have no ViewState. ViewState only holds the values ofproperties that are dynamically changed somehow, usually in code,data-binding, or user interactions, so that they can be restored oneach request. ViewSate does not hold "controls", it only hold valuesand the ID's of the controls they belong to.


JoshStodola:

The reason for view state is this: Say you fill out a form, submit it, and it displays a second page that says you have an error. If you click the back button and you have viewstate disabled, the fields are emtpy. If viewstate is enabled, the data is retained. It is a way of retaining the data on the client machine momentarily.

Hope this helps!

For correct view state understanding, please visit the link below

Understanding ViewState

HC


Wow, Mr.B!

Why don't you post a link to Peter Bromberg's explanation instead of try to take credit for it.


Because:

a) it's one extra link - I hate people who post solutions which involve clicking on a link to THEN find the information.

b) I don't want to take credit for it - I just wanted the question answered correctly, rather than answered incorrectly.

For those that care, here is the link to the original article:

http://www.eggheadcafe.com/articles/20060208.asp

No need to take offence just because you got something wrong!

Smile


First of all, that is a published article with a copyright statement at the bottom of the page. Why would you copy and paste the contents without at least giving credit to the source? Because you wanted to take credit for it. Have some respect!


I have already posted the link to the original article, get off your high horse and get back to providing incorrect answers to people's questions.


Mr^B:

Nope that's not correct, it's got nothing to do with the back button - that's to do with your browsers own cached version of the page itself - it has nothing to do with Viewstate.

Here's a quick overview:

WhatViewState Isn't:

ViewState does not restore posted values to controls on a WebForm.
If you disable a control's ViewState, you will see that its value is still restored.

ViewState does not automatically recreate any controls that were dynamically created in the code.
Dynamically created controls on a page must be recreated when the page PostBack is processed.

ViewState is not for user or session data or for transferring data across pages.
Viewstate only can store data that is sent back to the same page during a PostBack operation.

ViewState does not hold "Controls".
Viewstate does not normally hold entire controls - only values and properties.

What ViewState is:

Viewstate represents thestate of the page when it was last processed on the server. ViewState is used to track and restore the state values of controls that would otherwise be lost, either because those valuesdo not post with the form or becausethey are not in the page html.A control defined solely in your page html with no changes made in thecode will have no ViewState. ViewState only holds the values ofproperties that are dynamically changed somehow, usually in code,data-binding, or user interactions, so that they can be restored oneach request. ViewSate does not hold "controls", it only hold valuesand the ID's of the controls they belong to.

Sadly, and much as I rate Peter's work, there are some minor errors of fact in his article.

For example, the statement "A control defined solely in your page html with no changes made in thecode will have no ViewState." is tragically flawed (unless, by control, you mean non-server side html element, which won't use ViewState anyway as it has no server-side presence). Here's why.

A boring, plain old asp:TextBox uses ViewState to determine whether it should raise its TextChanged event on the server. It works thus:

1. During render, it spits out the current value of the control as part of the standard <input> element; also, it saves the current value of the control into ViewState.

2. On post back, it initialises the value of the control to the value read from ViewState. It then reads the value of the form variable for the relevant <input> element. It compares the values. If they are different, the control will raise its TextChanged event.

As you can see, this usage of ViewState occurs even if the control is not manipulated in any way in code, data binding or (and I can't see how this can apply to a server-side control anyway) as a result of user interaction.

Understanding this ViewState behaviour is important. For example, with ViewState disabled, the TextBox will raise the TextChanged event every time a form is posted back with a value that is different from that set initially in the server-side page,even if the user has not changed it during a specific round-trip sequence. With ViewState enabled, the TextChanged event is only raised after a round trip with the client where the user actually changed the text. Most, if not all, of the server-side controls adopt this behaviour for their server-sidexxxChanged events, and it's one of the reasons why you should not perform any significant coding in thexxxChanged event handlers.

Similarly, ViewState can be used to transfer state across pages in the case where cross-page postbacks are being used. Arguably, this would have to be considered a fragile design, but it does work nevertheless.

Peter's summary, and the Paul Wilson article from which it clearly derives, are both really good explanations but like all such summaries, (potentially) important information is sometimes dropped for brevity. Therefore, take care assuming that they represent definitive explanations.



Thank you DMW! That thing with the Event raised made things totally clear to me now.Wink