|
Hi there,
You can call the BreakMe method in the data binding express, but the Bind method cannot be used in this context, and you use the Eval instead. Something looks like:
Text='<%# BreakMe(CType(Eval("Address"),string)) %>'
|
|
|
|
|
Thankyou! That works perfectly.
I was trying something very similar, but using the Bind method - but of course it makes sense to use Eval in this context.
|
|
|
|
|
Hi,
I have a problem with a simple Composite Control I am trying to make.
It's in fact a superclassed control.
My projectname is SortedTextBox. My testapp is TestSortedTextBox.
SortedTextBox:
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
<toolboxdata("<{0}:sortedtextbox runat="server">")>
_
Public Class SortTextBox
Inherits System.Web.UI.WebControls.TextBox
Public Sub Sort()
Dim arrText As String()
arrText = Me.Text.Split(" ")
Array.Sort(arrText)
Me.Text = String.Join(" ", arrText)
End Sub
End Class
In my TestSortedTextBox I have to following html:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="TestSortedTextBox.WebForm1"%>
<%@ Register TagPrefix="Custom" NameSpace="SortedTextBox"
Assembly="SortedTextBox" %>
<title>WebForm1
<custom:sortedtextbox id="SrtText"
runat="server">
When I Build the project, it builds fine. However, when I want to
visualize the control (design view in VS.Net 2003) in
TestSortedTextBox, the control says "Error creating control". When I
run the project, of course I get an error at <custom:sortedtextbox
id="srttext" runat="server"> in Internet Explorer.
What do I forget? What do I do wrong?
|
|
|
|
|
Do you see the error details in the design view (or when you hover the error control)?
|
|
|
|
|
Yes, it's : Parser Error Message: Could not load type RedText.RedText from assembly RedText, Version=1.0.2459.29417, Culture=neutral, PublicKeyToken=null
|
|
|
|
|
What is the type RedText? I don't see it in your sample code, I think you may want to double check this type. Are you sure that this type is defined in the assembly RedText?
|
|
|
|
|
Sorry, other project, but in my 'redtext' project I have the same problem. This is the error on SortedTextBox: "Parser Error Message: Could not load type SortedTextBox.SortedTextBox from assembly SortedTextBox, Version=1.0.2460.14047, Culture=neutral, PublicKeyToken=null"
Here is the VB code again. Now I checked "Ignore HTML Text in this message" checkbox of this editor. It first 'eated' my HTML text, so the first code-snippet might be confusing for you.
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
<ToolboxData("<{0}:SortedTextBox runat=server></{0}:SortedTextBox>")> _
Public Class SortTextBox
Inherits System.Web.UI.WebControls.TextBox
Public Sub Sort()
Dim arrText As String()
arrText = Me.Text.Split(" ")
Array.Sort(arrText)
Me.Text = String.Join(" ", arrText)
End Sub
End Class
Here is the html again:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="TestSortedTextBox.WebForm1"%>
<%@ Register TagPrefix="Custom" NameSpace="SortedTextBox" Assembly="SortedTextBox" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<Custom:SortedTextBox id="SrtText" runat="server" />
</form>
</body>
</HTML>
|
|
|
|
|
And so I have this over and over again: when I try to explain the problem to somebody else, I very often see the solution while explaining:
vb-code:
Public Class SortTextBox....
html-code:
<Custom:SortedTextBox....
It should be:
<Custom:SortTextBox....
So, the conclusion is that the name after "custom:" must be exact as the class-name. I first thought it should be the projectname. Wrong thinking...
Anyway, thanks for listening to me!
|
|
|
|
|
You found this before I posted my reply and in case that you're not familiar with this stuff, you can have a look at the Register directve on the web page to get more information. Basically, in the Register directive you can specify:
+ The TagPrefix like Custom
+ The Namespace containing the control class.
+ The Assembly.
and the class should be declared properly in the control markup.
|
|
|
|
|
I'm studying the book 'Developing Web Applications with Microsoft Visual Basic.Net' to prepare myself for the 70-305 exam. So, I am not familiar yet with this stuff. Where can I find the Register directive? I searched trough the menu's of this page (no, I am not familiar with this website either)
|
|
|
|
|
|
Ooh, you're talking about the Microsoft-page. Sorry, I was looking at codeproject.
Yes, I heard about the new generation, and there is a good chance that I'll pick it up right after this exam. Just a few chapters, then do the exam, then I am in the possession of the MCAD certificate. ( I already did the 70-306 and 70-310 exam). Anyway, this study-program is set up by my company.
The new exams are 70-328 and 70-536 right? For the MCTS.
|
|
|
|
|
RCO-Man wrote: Ooh, you're talking about the Microsoft-page. Sorry, I was looking at codeproject.
But if there are any specific issues holding you back, you can come here to seek for help .
RCO-Man wrote: Anyway, this study-program is set up by my company.
Ah, Okay I see, you are in the progress.
RCO-Man wrote: The new exams are 70-328 and 70-536 right? For the MCTS.
Correct, and with 70-547 to become an MCPD (Web Developer), but once you have obtained the MCAD, you will only have to take the 70-551 exam to upgrade your status.
|
|
|
|
|
Your class name is SortTextBox , but the custom control markup is SortedTextBox .
|
|
|
|
|
Yeah, I found it while I was explaining the problem, but thanks for your help!
|
|
|
|
|
SqlConnection conn = new SqlConnection();
SqlCommand comm = new SqlCommand();
try
{
conn.ConnectionString = "data source = (local); initial catalog = MiratechDB; integrated security = true;";
conn.Open();
comm.Connection = conn;
could some1 pls explain to me how these codes work
and also how i can change it to have user login in the connection string pls
|
|
|
|
|
This is opening a database located on the local machine. The name of the database is MiratechDB.
It's in a try statement in case of failure. Usually it's a try/catch or something like that and if it fails you spit out an error message.
|
|
|
|
|
ic..
now i got a web host and i am trying to host the file so do i have to change any of these?
like to include user login in the connection string?
also could any one giv me any tips or website i can view to gain knowledge of how to host asp.net files
having a lot of trouble just Hosting the file......... plsss
|
|
|
|
|
Hi,
U should change the following in the Connction string:
server name, database name, user id and password should be changed to that of the server in which u r going to host.
I dont know abt any sites.. But I can tell u simple procedure..
You have to upload your project files and the database backup to the server by using FTP or Remote Desktop COnnection available in Windows...
In the Server machine,
Then u have to go to IIS in Control panel->Administrative Tools
In IIS, right click Deault Web Site and create an new virtual directory. Browse and specify the location of ur copied files..
Then regarding database, restore the backup database to the server.
Then u have successully hosted ur web project...
Regards,
sdaniel_cst
|
|
|
|
|
firstly do you think you could giv me the sysntex of the connection string which include the server name, database name, user id and password pls.
as i dont have any.
also about your procedures, i already put all my asp files into a sub folder in my webpage using ftp. however i would like to ask if i need to compile them or anything? coz i simply put ALL the files into that subfolder >.<
and lasty wat u mention in the server machine.
do u mean i have to go to the control panel that the web host gives me and set up the lls? as i recall doing this on my computer before but i am trying to host them on a real web page now.
|
|
|
|
|
Hi,
An example of connection string
dim con as new Sqlconnection
dim str as string
str="server=MACHINENAME;database=DATABASENAME;uid=sa;pwd=sa;"
con.connectionstring=str
con.open()
You have to just copy ur files to the web server by ftp and then create a new virtual directory in IIS as I mentioned earlier.Thats all. Then u type the url
and check whether it is working..No need of any compiling.
Server means the machine in which u will be hosting the site, which u will be logging by remote desktop connection
Regards,
sdaniel_cst
|
|
|
|
|
hi,
I am using WEB Services (Soap) to run my application. While debugging its working fine.
.I installed both web server and also client website.
I am trying to run client site it showing
“No connection could be made because the target machine actively refused it error “.how to resolve this problem.
I want to know How to set up this WEbServces and how to link this web services setup with my application setup. Is any one knows it. Please help me.
kamalnath
|
|
|
|
|
Hello,
can you try to check the websrvice during test from the server (call it from localhost)?
Maybe there are configuration mistakes in different inet-zones?
Second: Can you post a screenshot from the IIS-Config of the settings from virtual folder for the WS? Especially access rights? Which OpSys runs on the server?
BR
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Hi,
You might test your web service from your local, it was working fine. Is it? When you try to implement that web service on another server you are getting error. There is a property for web services called "URL Behavior" it is a boolean property, that needs to be set as true. Go through following link.
http://www.codeproject.com/soap/wsdldynamicurl.asp
Ram
|
|
|
|
|
while installing dot net 2005 in my machine i found a problem
"suite toolkit executable" and automatically quit from installing.can anyone please tell me what can i do for that?
my system configutation is
os-windows-xp service pack 2
intel motherboard
intel 3.06Ghertz processor
512mb ddr ram
80 gb harddisk
awaiting ur reply
coding makes me interesting in dot net
|
|
|
|