|
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
|
|
|
|
|
i want to create a custom control for my project.
how to do this
can any body help me regarding this
|
|
|
|
|
|
Hi guys,
I'm having a problem with a grid view. It all works great, but i added a set of textboxes that are used to generate a filter string. This filter string works fine, and enables me to sort, edit, delete, etc.
The problem i have now is that when i delete (via delete command) or insert (via a seperate form) an item, the datagrid re-freshes without the filter being applied.
I've tried re-applying the filter string to the ODS, i've also tried re binding the DataGrid. Neither of these has any effect.
Can anyone point me in the direction of a fix?
Cheers
Tris
|
|
|
|
|
Hi,
How do i create a template column containing an image at the end of a datagrid.Thanks in advance...
|
|
|
|
|
Runtime or design time??
[design time]
- Right Click on Datagrid.
- Click "Property Builder"
- Go To "Column"
- Add "Template" Column.
- Click "OK"
- Right Click on datagrid again.
- Select "Edit Template" (you wil see all template columns.)
- Select Last Column. (eg: Column [3])
- Add Image Control in ItemTemplate.
- Click "End Template Editing"
That's all.
[Runtime]
Dim tCol As New TemplateColumn
tCol.ItemTemplate.InstantiateIn(New System.Web.UI.WebControls.Image)
dgOvertimeRate.Columns.Add(tCol)
Try those codes. Hope it works.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message. Thank you.
|
|
|
|
|
i want to travel on one website through .net coding.
i.e i have one web project and it contains one web form.
i have one website. in that web site contains search field box. thorugh coding i have to give value for that search filed and trigger the go button.
for example if i want to search the topic "TriggerButton" on google means i have to manually open that site and write TriggerButton in the search field box and click the google search button.
is it possible to do it through .net coding. (give value to that search field box and trgger the click event. )
|
|
|
|
|
|
Hi,
I'm trying to deploy my asp.net web application, but I don't know how can I access the default web page after I install the application on another computer??
Can someone please tell me in details how to depoly my web application and how to use the application after installation.
I'm using Visual Studio.Net 2005, Asp.net 2
I also want to add to the installation file, the .Net framework just in case the other computer doesn't have it??
|
|
|
|
|
Hi,
Just follow below steps:
------------------------
1. New -> File -> New Project
2. Expand Other Project Types (in Project Types Tree)
3. Click Setup and Deployment
4. Select Web Setup Project
5. Enter some file name and save it
6. Right click Web Application Folder (in (File System Tree).
7. Click Add
8. Add all web files (.aspx and .aspx.cs) as much as you wanted.
9. If you want to create new folder under main folder, right click the Web Application Folder -> Add -> New Folder.
To set default .aspx file for your web application
---------------------------------------------------
1. Click properties of Web Application Folder
2. Change the file name in ‘DefaultDocument’
a. Can be default.aspx or index.aspx or anything
3. You can also change the ‘VirtualDirectory’ (so that web application can be accessed as 'http://<servername>/<VirtualDirectory>'
a.Server name – can be localhost or machine name if deployed in some other
machine
b.Virtual Directory (optional) – can be your project name. If it is blank,
then files will be copied in the main directory i.e folder will not be
created.
Once you are done, now rebuild the solution. This will create .msi file in the debug/release folder in the saved directory.
When you are delivering a project, always change to Release mode. So that file will be created in Release folder
Finally for deploying the web application, double click that .msi, this will deploy in the server. Open Inetmgr and check all files are copied.
Is this easy nah ??! Fine
- Harini
-- modified at 6:57 Thursday 22nd February, 2007
|
|
|
|
|
Nice I given 5 score for this.
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|