|
How about we make things simple - Masterpages.
As was pointed out ASP.NET simply renders to HTML and usually includes plenty of HTML tags on a page.
|
|
|
|
|
Hi,
When I try to install a starter kit, for example DotNetNuke or Commerce Starter kit from a .vsi file, I get the following error:
A problem occured while running the installer. Please contact the content auther for problems with the content.
Error message:
String cannot have zero length.
Please can someone tell me why this is the case? Have I deleted certain folders? I have never had this error before and I have installed other starter kits on my PC, but I deleted them manually a while ago. If there is problems with the installer, how can I/where can I re-install it?
I am using VS2005.
Regards
ma se
|
|
|
|
|
|
Probably a dumb question but hopefully someone can help me.
I just installed MS Enterprise Library to use Data Access Application Block. I can't seem to find the .dll file under "Add Reference" dialog box to make reference in my project.
I found the .dll under "C:\Program Files\Microsoft Enterprise Library January 2006\bin" folder but I am not sure if this is what I need to reference!
Should it not appear in the "Add Reference" dialog box?
Thanks in advance.
|
|
|
|
|
In the "Add Reference" dialog box there is a tab called "Browse", use that to navigate to the folder you mentioned. Usually this is the way you reference 'addons'.
|
|
|
|
|
Taurian110 wrote: Should it not appear in the "Add Reference" dialog box?
It does, but it is displayed as something odd. (But, it makes sense after a while)
Microsoft Patterns and Practices.... (I think)
Taurian110 wrote: I found the .dll under "C:\Program Files\Microsoft Enterprise Library January 2006\bin" folder but I am not sure if this is what I need to reference!
If you go browsing for it then that's the one.
|
|
|
|
|
The dll from assembly folder shows in "Add Reference" dialog. So, If you wanna see those dlls then you should add them into Assembly Folder. but made sure these dlls have strong key..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
hello all,
i'm trying to change an sql command string by assigning a strSelected variable and injecting it into a WHERE clause, but it keeps coming up null:
<br />
public partial class _Default : System.Web.UI.Page <br />
{<br />
public string strSelected;<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!Page.IsPostBack) <br />
strSelected = "*";<br />
<br />
String sConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +<br />
"Data Source=" + Server.MapPath ("ExcelData.xls") + ";" +<br />
"Extended Properties=Excel 8.0;";<br />
OleDbConnection objConn = new OleDbConnection (sConStr);<br />
objConn.Open ();<br />
<br />
OleDbCommand objCmdSelect = new OleDbCommand ("SELECT " + strSelected + " FROM myRange1", objConn);<br />
OleDbCommand objCmdSelectFirstname = new OleDbCommand ("SELECT Firstname FROM myRange1", objConn);<br />
OleDbCommand objCmdSelectLastname = new OleDbCommand ("SELECT Lastname FROM myRange1", objConn);<br />
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter ();<br />
objAdapter1.SelectCommand = objCmdSelect;<br />
DataSet objDataset1 = new DataSet ();<br />
objAdapter1.Fill (objDataset1, "XLData");<br />
GridView1.DataSource = objDataset1.Tables[0].DefaultView;<br />
GridView1.DataBind ();<br />
<br />
objConn.Close ();<br />
}<br />
<br />
protected void lbQuery_SelectedIndexChanged (object sender, EventArgs e) {<br />
switch (lbQuery.SelectedValue) {<br />
case "firstName":<br />
lblSelected.Text = "First name query selected.";<br />
strSelected = "Firstname";<br />
break;<br />
case "lastName":<br />
lblSelected.Text = "Last name query selected.";<br />
strSelected = "Lastname";<br />
break;<br />
case "entireRange":<br />
lblSelected.Text = "Entire range query selected.";<br />
strSelected = "*";<br />
break;<br />
default:<br />
lblSelected.Text = "Select query type above.";<br />
break;<br />
}<br />
}<br />
}
but whenenver i click on any of the items in the lbQuery listbox it seems like it reiterates to strSelected being null due to the declaration of the variable at the top. any pointers as to how to go about this?
thanks in advance,
M.
|
|
|
|
|
It doesnt look like you're ever doing anything with it after you set it to the column name. The button click event takes place after the Page_Load event so if you want to run that query again you need to place it inside it's own method and call it from both places respectively.
Cleako
|
|
|
|
|
Dear CPians,
I am using the Page.IsPostBack property. When this evaluates to true, hence I am within a post back, I want, in some cases to cancel the post back. I need to prevent it of happening in case some condition evaluates to true.
Example:
if (Page.IsPostBack)
{
if (something == true)
{
DO SOMETHING TO CANCEL THE POSTBACK
}
}
Is there a way to prevent it of happening?
Thanking you in advance
|
|
|
|
|
What exactly do you mean cancel the postback? You could use Response.Redirect() or Response.End() but I don't think thats exactly what your after. Please explain more.
|
|
|
|
|
Actually a redirect would do it.
thanx
|
|
|
|
|
I may be misunderstanding what you're trying to accomplish, but it sounds to me as if you should be doing your evaluation on the client-side and preventing the form submission rather then trying to evaluate it on the server after the postback has already taken place.
More information on what kind of conditions you're evaluating would prove helpful, if you're still interested in gathering opinions.
--Jesse
|
|
|
|
|
If there is an event causing the post back it is best to deal with this in that event, not the Page_Load. Then if something isnt the way you want it just exit that sub.
Cleako
|
|
|
|
|
I have some concerns about the stability of the SiteMapPath control for ASP.NET 2.0. First the programmatically modify SiteMap Nodes in Memeory described at ms-help://MS.MSDN.vAug06.en/dv_aspnetcon/html/76f0cf95-d0fd-44c9-8a07-93173beb6e22.htm changes the nodes, however, it seems to be called each time you navigate forward or backwards. So each page node is overwritten with the same info. It seems the static method call for assigning this is the issue. Second after reopen the web browser the Crumb trail displays the incorrect path. I typically have to restart the web server in order to clean it out of state. Third SiteMapPath crashes if it detects more then one node pointing to the same url. Does any one know of how to fix any of these problems? It seems that Microsoft has not bothered to test this control before releasing it. (Suprise Suprise!) I think I will need to make a new SiteMapPath object that works. This control is too problematic to be taken seriously.
nothing
|
|
|
|
|
Hi guys,
How can I change the flash object opacity value through javascript on my web form. Can somebody demonstrate some examples.
Thanks
|
|
|
|
|
|
Acutally, I had a flash object on a webform and i was trying to display an ajax modalpopup. The modalpopup was poping up behind the flash object bec flash swf file by defualt is on the top of the the other objects. Iwas thinking if i change the flash obeject opacity property and increase the modalpopup opacity value then i may get some different result. accidently, i found out that flash have this article that covered but problem.
Thanks anyway for your kind reply.
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14201
|
|
|
|
|
When working with the Ajax Accordion control and filling it with data from a dataset; it only accepts the last entries on the last pane.
Why doesn't it accept earlier data in the dataset?
F.i. if i have 3 records in the dataset only the data from record 3 is accepted in pane 3 ; no data is accepted in pane 1 and 2 (no header and no content; Does somebody have a clue?????
DataSet dsAnalyse = new DataSet();
dsAnalyse = CLSPMTDatabaseGeneral.SelectAccordion(datDate);
DataTable DT = dsAnalyse.Tables[0];
AccordionM2.Panes.Clear();
int i = 0;
foreach (DataRow DR in DT.Rows)
{
AjaxControlToolkit.AccordionPane panel = new AjaxControlToolkit.AccordionPane();
lt.Text = DR["PanelMessage"].ToString();
panel.HeaderContainer.Controls.Add(lt);
lb.Text = DR["PanelMessage"].ToString();
panel.ContentContainer.Controls.Add(lb);
AccordionM2.Panes.Add(panel);
i = i + 1;
}
bellenp@schneider.com
|
|
|
|
|
Where are lt and lb defined? It looks like you are not creating new instances of them before you add each to the panel. Instead, you appear to be adding the same instance over and over and changing the values each time. In that case, the last value (row 3) will be the only one to show up. I'd suggest that you try creating a new instance of lt and lb inside the loop, before setting the text.
Hope that helps.
--Jesse
|
|
|
|
|
Scenario:
I've a WebFarm with 2 web servers which are NLBs (network load balanced).
Web1 and Web2; they are not part of a domain.
I have a third server, Server3, which is part of a domain and on the same physical network, and it has an MSAccess database which is used on the external webfarm as well as on the internal intranet. I can connect via the intranet because the DB file is on the same box from which the intranet is being served (Server3)
While I've got code below which is VB.NET-related, to me I think this is an OS-related topic; but I could be wrong..
How can I 'connect' to the MSAccess database file on Server3 from either Web1 or Web2?
When I use the code below, I get this error:
The Microsoft Jet database engine cannot open the file '\\Server3\C$\MSAccessDBs\Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
Any clues?
Here's more info:
I'm using ASP.NET v1.1, using a standard OLEDb connection (referencing the database by path [see code below]).
From the ASP.NET v1.1 "web.config" file (I'll refer to this as ConnectStringA)
1 [appSettings]
2 <[dd key="strConnectAccess" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Server3\MSAccess\DatabaseFile.mdb"/]
3 [/appSettings]
actual "connect" code:
... I'm pausing here.
I went to go look at the connection code and there is a direct inline connection string to another database which ap[ears to not be failing:
\\Server3\C$\MSAccess\LogError.mdb
--> I'll refer to this as ConnectStringB,
The difference between ConnectStringA and ConnectStringB is that ConnectStringA assumes a shared folder, whereas ConnectStringB goes direct, as it includes the "\C$" element.
Well, I added the "\C$" to ConnectStringA, (now "\Server3\C$\MSAccess\DatabaseFile.mdb") and it still fails.
Yes, I would agree there is some sort of permissions error. The database is set for Shared.
Here is my "connect" code (modified to protect a client's database)
1 Sub btnlogin_click(ByVal sender As Object, ByVal e As EventArgs)
2 Dim conpw As OleDb.OleDbConnection
3 Dim cmdpw As OleDb.OleDbCommand
4 Dim strsql As String
5
6 Dim dappw As OleDb.OleDbDataAdapter
7 Dim dstpw As DataSet
8 Dim rowpw As DataRow
9 Dim bldpw As OleDb.OleDbCommandBuilder
10 Dim inti As Integer
11 Dim rdrpw As OleDb.OleDbDataReader
12
13 Dim xx As String
14 Dim yy As String
15 Dim strmsg As String
16 Dim strcounties As String
17 Dim lngposition As Long
18 Dim strIsCSR As String
19
20 If txtIsCSR.Checked = "True" Then
21 Session.Contents("IsUser2") = "True"
22 Session.Contents("userName2") = txtUserName.Value
23 Session.Contents("userPass2") = txtPassword.Value
24 Response.Redirect("user2Logon.aspx")
25 End If
26
27 lngposition = InStr(txtPassword.Value, "'")
28 If lngposition > 0 Then
29 Response.Redirect("loginError.aspx")
30 End If
31
32
33 conpw = New OleDb.OleDbConnection(ConfigurationSettings.AppSettings("strConnectAccess"))
34 conpw.Open()
35
36
37 strsql = "SELECT * " & _
38 "FROM [ User] " & _
39 " WHERE ( ([ User]].UserName = '" & txtUserName.Value & "') AND ([ User].password = '" & txtPassword.Value & "') ) "
40
41 cmdpw = New OleDb.OleDbCommand(strsql, conpw)
42 rdrpw = cmdpw.executereader
43
44 xx = 0
45 While rdrpw.read
46 xx = xx + 1
47 strmsg = rdrpw.item("userID") + rdrpw.item("userName")
48 strcounties = strcounties + strmsg
49 End While
50
51 conpw.close()
52
53 If xx > 0 Then
54 Session.Contents("counties") = txtMemberid.Value
55 Response.Redirect("Here.aspx")
56 Else
57 If Len(Trim(Session.Contents("logintrys"))) = 0 Then
58 Session.Contents("logintrys") = 0
59 End If
60 ctry = (Session.Contents("logintrys"))
61 ltrys = CInt(ctry) + 1
62 If ltrys > 6 Then
63 Response.Redirect("lockout.aspx")
64 End If
65 ctry = CStr(ltrys)
66 Session.Contents("logintrys") = ctry
67 Response.Redirect("loginError.aspx")
68 End If
69
70 End Sub
So, in all, this error [below] is occuring, it does point to "permissions" of some kind, I think. the Database is not set to exclusive. "Everyone" and "guest" have "Read/Write" to all files in folder (yes, a security hole).
The Microsoft Jet database engine cannot open the file '\\Server3\C$\MSAccessDBs\Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
FYI ~ I have set all 3 servers up with the same username/password (used by IIS). The user account on Server3 has full control to the folder and file.
I did create a page on Web1 and Web2 that accesses an image in the same directory on Server3 (for display on a web page), and the image displays fine.
I did visit Microsoft's website and read through several KB articles, but no success; #253580, #315276 (NTRights Utlitity)
The NTRights utility (KB #315276) adds permissions from ServerA to access content on ServerB.
Thing is, how to I "connect" from a webfarm not on a domain to a server (Server3) which is on a domain?
ASP ~ Apple Simply Performs
|
|
|
|
|
Check if you have access rights on the table you are trying to view. If the account you log on with the connection string doesn't match the table access rights you may get that message. Thats one possible check. There is also a connection attribute that needs to be assigned for DataReaders to work correctly. Asynchronous Processing=true; I believe Good luck
nothing
|
|
|
|
|
Dear All,
I am making web application using Asp.net C#(Visual Studio2005).
I want to populate web control based on dropdownlistbox value.
I tried this code
Label lbl = new Label();
lbl.Text = "Welcome ";
TextBox txtname = new TextBox();
txtname.Height = 50;
txtname.Width = 20;
PH1.Controls.Add(lbl);
My problem is how can I place this controls to perticular place.
Please Guide me or atleast give some help full link.
thanks
regards
imran khan
|
|
|
|
|
HI
Instead of Adding Directly to page Add Place Holder staticly where you want to show the control then at Run time add the dynamically created control to the place holder Also you have PH1.Controls.AddAt(child control) method
i don't know much about that
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Apply a style and use css to position the control where you want it, either absolute or relative, etc.
only two letters away from being an asset
|
|
|
|