
wayneph
Members-
Posts
25 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by wayneph
-
We have a 3rd party app that has been installed to one of our network servers and is to be run from a share. In the documentation that came with the program, the company has stated that they wanted the Local Intranet CAS settings ste to Full Trust. I don't have a huge problem with that, but it seems like a bit of overkill to me. There are also about 500 users (many without local admin rights) that would need to update this, and I don't want to have to go to every machine. I know that caspol.exe will allow me to update settings, and I can also specify just a specific share to give privledges to. The network group can probably push it out as a script that updates the entire network in one swoop. The problem is that for the life of me, I can't come up with the right combination of switches... Can anyone provide some samples that use caspol to give Full Trust to a share? (or the entire Local Intranet for that matter...) I'll need to run this for both the 1.1 and 2.0 frameworks, but I assume that once I have one command line, the other will be the same.
-
Here's a JavaScript function from one of the sister sites: http://www.xtremevbtalk.com/showthread.php?p=390844
-
Do you need to PostBack? Or do you just want to bring it up like a link. The easiest way is to Add a Target Attribute to a link. Otherwise if you just need to bring up a link you can use client side JavaScript. If it posts back, then during the page rendering you'll need to spit out some JavaScript to tell Frame2 to change as well. (One possible JavaScript example is here: http://www.pageresource.com/jscript/jframe2.htm)
-
OK, I am finally getting around to playing with 2.0 and the new Data Web Controls that we have available. I must say it will be nice being able to do more things with out having to go into the code. However, I hit a snag. To limit round trips to the database, I often create stored procedures that return multiple resultsets. When using a Dataset, they just get put in as multiple tables, I set a Data Relation between them and everything is happy. Now I am trying to do something similar with a SQLDataSource. So far I have been able to set up the Select Query and populate a control with the contents of the first result, but I haven't found a way to the second table or a way to define the relation between the tables. Has anyone done anything similar, or know of a way to work with this?
-
Assuming your Header uses TH you can try something like this: TH {border-bottom: 1px solid #99CCCC;} Otherwise just give the heading a separate class name and chage the Style definition from TH to what ever new class you set up.
-
Exporting to Excel, refining data exported.
wayneph replied to mike55's topic in Database / XML / Reporting
Instead of doing select *, I would select the exact columns that you need. Then you can use SQL to return the blanks directly from the database. The syntax will be a little different depending on what database you're using but in SQL Server, it would be the CASE WHEN construct, and in Access it would be an IIf(...) statement. Then you're ASP code doesn't have to worry about the value at all. It's already taken care of. -
I'd use something like this to prevent the user from clicking edit. It will clear out the controls from the "Edit" column in the ItemDataBound so that the buttons don't even show up. Private Sub dgRecs_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _ Handles dgRecs.ItemDataBound If IsDate(e.Item.Cells(8).Text) Then 'Replace the index with the column of your Edit Column e.Item.Cells(10).Controls.Clear() End If End Sub
-
2 extra clicks on their site takes you to their Free for home use version: http://www.grisoft.com/doc/289/lng/us/tpl/tpl01
-
The code from your "MostrarSTgrupo" Sub needs to be executed as part of the Page_Load. The ID needs to be set and added back into the forms controls collection before it will fire the events. Otherwise, the rest looks OK.
-
My suggestion would be to use the ItemDataBound function with some Static variables. and do something like this... (untested because I don't have time to set up a database right now) Public Sub HideCells(ByVal sender As Object, _ ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Static col1Value as String Static col2Value as String Dim dr as DataRow = CType(e.Item.DataItem, DataRow) If e.Item.ItemType = ListItemType.AlternatingItem Or _ e.Item.ItemType = ListItemType.Item Then If dr.Item("col1Name") <> col1Value Then e.Item.FindControl("lblCol1").visible = true col1Value = dr.Item("col1Name") e.Item.FindControl("lblCol2").visible = true col2Value = dr.Item("col2Name") ElseIf dr.Item("col2Name") <> col2Value Then e.Item.FindControl("lblCol1").visible = false e.Item.FindControl("lblCol2").visible = true col2Value = dr.Item("col2Name") Else e.Item.FindControl("lblCol1").visible = false e.Item.FindControl("lblCol2").visible = false End If End If End Sub if column 1 and column two always change together, you can probably get away with just the first and last part of the conditional. This loop will handle the following situation: Header1 Header2 Header3 asdf qwer 1234 2345 yuio 4564 3456 9876 hjkl vbnm 7667 ...
-
This isn't new to 2003: Go to IIS - Right Click on the Web Site and go to Properties. Go to the Home Directory Tab and click on Configuration. On the AppDebugging Tab you can tell it to send a generic message or the error details.
-
I'm going to suggest global.asax, but not the Session sub. Can you do it as part of the Begin Request? This fires each and everytime a page from the application is requested. Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) ' Fires at the beginning of each request End Sub
-
I would actually use multiple controls. Set up your data in a DataSet with a Customers DataTable and Address DataTable and a Data Relation between them. Then I'd use a DataList for the Customers Information, and Nest either a DataGrid or another DataList in the ItemTemplate for the Address informaiton. The DataSource for the nested table would be based on the DataRelation between the two datatables. This article has some sample code and a pretty detailed description of using the DataGrid. You'll just have to apply the same techniques to a DataList.
-
I haven't had a chance to play with it yet, but I have to agree that I don't have many problems with IE 6... As far as tabbed browsing goes, I like the way it currently works in XP when you have the taskbar grouping turned on. It's the benefit of Tabbed browsing when you need it. If they can move it into an MDI type form and keep my Alt-Tab to each browser page while tabbing between programs at the same time I would accept that as well. I think I'll start the download tonight, and try to get it installed on one of my machines I just replaced.
-
<a href='WindowTreatment_Home.aspx?IDDepartment=<%# DataBinder.Eval(Container.DataItem, "DepartmentID") %>&IDCompany=<%# DataBinder.Eval(Container.DataItem, "CompanyID") %>'> Or you can create a Link Button and have your code-behind form add as many variables you like
-
I set the Forms Cookie timeout so that it is the same as my session time out. Set the session time out either in IIS MMC plugin or in code by Session.TimeOut = 20. (20 minutes is the default.) Then in your web.config file where you set up the forms authentication you just add a timeout attribute. here is a sample of one of my definitions: <forms name=".authcookie" loginUrl="login.aspx" protection="All" timeout="20" /> Since the cookie and the session both expire at the same time, the problem should weed it self out.
-
As soon as I hit post, I came up with a way to solve the first part. This new OnPreRender function takes care of the JavaScript. The other is really just cosmetic, if someone has an answer. Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) If EnableClientScript Then 'Add the Attribute to the HTML for the verify Function Me.Attributes("evaluationfunction") = "crv_verify" Me.Attributes.Add("QuestionControl", QuestionControl) Me.Attributes.Add("QuestionAnswer", QuestionAnswer) 'Create the Javascript function to check the control Dim sb As New System.Text.StringBuilder sb.Append("<script language=""JavaScript"">" & vbCrLf) sb.Append(" function crv_verify(val) {" & vbCrLf) sb.Append(" var tmp = document.getElementById(val.QuestionControl);" & vbCrLf) sb.Append(" var response = true;" & vbCrLf) sb.Append(" if (tmp.options[tmp.selectedIndex].value == val.QuestionAnswer) {" & vbCrLf) sb.Append(" if (document.getElementById(val.controltovalidate).value == """") {" & vbCrLf) sb.Append(" response = false;" & vbCrLf) sb.Append(" }" & vbCrLf) sb.Append(" }" & vbCrLf) sb.Append(" return response;" & vbCrLf) sb.Append(" }" & vbCrLf) sb.Append("</script>" & vbCrLf) 'Register the Script Block. Me.Page.RegisterClientScriptBlock("CRV", sb.ToString()) End If MyBase.OnPreRender(e) End Sub
-
Well, I have created something that works, but I'm not 100% happy with it. I know there should be a way to do it where I don't write out a seperate JavaScript Function for each one, but I can't think of it right now. My problem is finding a way to specify the "QuestionControl" and "QuestionAnswer" in such a way that they are available to the JavaScript function. The other thing that would be nice is the ability to set up the "QuestionControl" so that when you are in the .NET designer, you have the dropdown list of controls similar to what is available for "ControlToValidate". I've attached my class. I'd like to hear any suggestions if anyone has some... ConditionallyRequiredValidator.txt
-
Search for a Value in the Primary Key Column in Datatable
wayneph replied to marlin's topic in Database / XML / Reporting
Will this work? Dim r as DataRow = myTable.Rows.Find(ValueToFind) If r Is Nothing Then 'The Value was NOT found Else 'The value was found End If -
I was about to set up a new validation control, but I decided to ask and see if there is one out there, that would save me some time. Here is what I'm looking for. I have a question with DropDownBox that has ListItems of "Yes" and "No" for answers. Next to the DropDownBox I have a Textbox that will be required depending on the answer of the associated question. In my mind I see needing 3 properties: ControlToValidate, ConditionalControl, AnswerWhenRequired. In the associated Code, if the ConditionalControl = AnswerWhenRequired and ControlToValidate is blank, then the Validator is not valid. Does anyone know where to find something like this, if it already exists?
-
I protect my databases by not putting them in the web share. If I'm using Access I'll set up my application structure like this. /ApplicationName /Databases /www Then I will set up the www folder as the root of my web share. Then you can give the IUSER necessary permission to use the database, with out worring about someone downloading it.
-
I found an answer... Here is the updated ascx file if anyone ever runs into the same problem. I had to change the nested DataSource, and the way the DataBinder finds columns from the second table. linkColumn.ascx <%@ Import Namespace="System.Data" %> <%@ Control Language="c#" AutoEventWireup="false" Codebehind="linkColumn.ascx.cs" Inherits="startpage.linkColumn" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <asp:DataList id="catList" runat="server" Width="270px"> <ItemTemplate><DIV style="DISPLAY:inline; FONT-WEIGHT: bold; FONT-SIZE: 12px; Z-INDEX: 102; LEFT: 0px; WIDTH: 270px; COLOR: white; HEIGHT: 15px; BACKGROUND-COLOR: #000066" ms_positioning="FlowLayout"><%# DataBinder.Eval(Container.DataItem, "Category") %></DIV> <br><asp:DataList runat=server ID='linkList' DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("catLink") %>'> <ItemTemplate> <asp:HyperLink runat=server NavigateUrl='<%# DataBinder.Eval(Container.DataItem,"[\"LinkURL\"]") %>'><%# DataBinder.Eval(Container.DataItem,"[\"LinkName\"]") %></asp:HyperLink> </ItemTemplate> </asp:DataList> <DIV style="DISPLAY:inline; WIDTH:170px; HEIGHT:8px; font-size:6px;" ms_positioning="FlowLayout"> </DIV> </ItemTemplate> </asp:DataList>
-
I didn't realize that JavaScript would allow you to pull the file name out of a <input type=file> field. That would allow you to still use a Browse button, which is always nice.
-
By using the <input type=file> you're telling the page to upload the file. unfortunately that's the only way you can do it. If the databases are in a common place on the server, you could always go and get a list of them, and give the user a dropdown list to choose from. If they're in multiple directories, you could start them out in the root and then let them click through on web pages. It may mean a few more clicks, but you won't have the databases being sent to the server with the request when you don't need it.
-
i'm having a problem getting everything right using a nested DataList. I thought I had done pretty well following an example, but apparently I'm missing something. here is the code for both the ascx and the code behind. (it's a user control) The error it's giving me is when I add the datasource to the nested DataList. Error: CS0117: 'object' does not contain a definition for 'Row' Location: Line 5:<br><asp:DataList ID='linkList' DataSource='<%# Container.DataItem.Row.GetChildRows("catLink") %>'> I've tried a few different variations on this, but it doesn't seem to be working. linkColumn.ascx <%@ Control Language="c#" AutoEventWireup="false" Codebehind="linkColumn.ascx.cs" Inherits="startpage.linkColumn" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%> <asp:DataList id="catList" runat="server" Width="270px"> <ItemTemplate><DIV style="DISPLAY:inline; FONT-WEIGHT: bold; FONT-SIZE: 12px; Z-INDEX: 102; LEFT: 0px; WIDTH: 270px; COLOR: white; POSITION: absolute; TOP: 0px; HEIGHT: 15px; BACKGROUND-COLOR: #000066" ms_positioning="FlowLayout"><%# DataBinder.Eval(Container.DataItem, "Category") %></DIV> <br><asp:DataList ID='linkList' DataSource='<%# Container.DataItem.Row.GetChildRows("catLink") %>'> <ItemTemplate> <asp:HyperLink NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "LinkURL") %>'> <%# DataBinder.Eval(Container.DataItem, "LinkName") %> </asp:HyperLink> <br><DIV style="DISPLAY:inline; WIDTH:170px; HEIGHT:8px; font-size:6px;" ms_positioning="FlowLayout"> </DIV> </ItemTemplate> </asp:DataList> </ItemTemplate> </asp:DataList> linkColumn.ascx.cs namespace startpage { using System; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; /// <summary> /// Summary description for linkColumn. /// </summary> public class linkColumn : System.Web.UI.UserControl { private int colNum; protected System.Web.UI.WebControls.DataList catList; protected System.Web.UI.WebControls.DataList linkList; public int ColNum { set { this.colNum = value; } } private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if (!IsPostBack) { //The user is set up with access to the correct database as the default database. SqlConnection conn = new SqlConnection("SERVER=raynedc;UID=********;PWD=********;"); SqlDataAdapter daCat = new SqlDataAdapter("SELECT * FROM categories WHERE CatColumn=" + this.colNum + "ORDER BY CatOrder",conn); SqlDataAdapter daLinks = new SqlDataAdapter("SELECT * FROM links INNER JOIN categories ON links.CatID = categories.CategoryID WHERE categories.CatColumn=" + this.colNum + " ORDER BY CategoryID, LinkOrder",conn); DataSet ds = new DataSet(); daCat.Fill(ds.Tables.Add("categories")); daLinks.Fill(ds.Tables.Add("links")); ds.Relations.Add("catLink", ds.Tables[0].Columns[0], ds.Tables[1].Columns[1]); catList.DataSource = ds.Tables[0].DefaultView; catList.DataBind(); } } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } } Just for Reference here is how the User Control is being created on my aspx page. <uc1:linkColumn id="LinkColumn1" runat="server" ColNum=1></uc1:linkColumn>