
mark007
Avatar/Signature-
Posts
185 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mark007
-
That's what PlausiblyDamp was saying - write the file directly to the output stream accessed via Response.OutputStream. :)
-
Well you can use one of: System.Windows.Forms.Application.ExecutablePath System.Windows.Forms.Application.StartupPath System.AppDomain.CurrentDomain.BaseDirectory() System.GetEntryAssembly().Location to get the application path and in asp.net there is server.mappath(). Therefore just use Application.StartupPath & "relative path" for example. :)
-
well ok but that's kind of code behind and separate file which I thought you wanted to avoid..
-
The standard datagriod has paging support. You can make it sortable using info here: http://aspnet.4guysfromrolla.com/articles/012903-1.aspx and as for excel it depends what you are after but you could probably just export your dataset to xml and load that in excel.
-
It just creates the folders. Something like: Private Sub CreateFolder(ByVal y As Integer, ByVal m As Integer) If Not System.IO.Directory.Exists(FOLDERPATH & y.ToString) Then System.IO.Directory.CreateDirectory(FOLDERPATH & y.ToString) End If If Not System.IO.Directory.Exists(FOLDERPATH & y.ToString & "\" & m.ToString) Then System.IO.Directory.CreateDirectory(FOLDERPATH & y.ToString & "\" & m.ToString) End If End Sub Where FOLDERPATH should be changed to reflect the parent folder of all the year folders. :)
-
Check out the cs and vb tags - they format your code and make reading much easier. :)
-
Not sure it's possible. I think each aspx page is compiled into 1 class. You might be able to create a private class within it to be used within that one page by using: private class MyClass End class If you go used to code behind I think you'd like it. Makes the aspx page much neater. :)
-
Do you have an exmaple that doesn't require a sign-in?
-
Lots of ways of doing this. One way would be: Dim m, y As Integer If DateTime.Now.Month > 8 Then m = DateTime.Now.Month - 8 y = DateTime.Now.Year Else m = DateTime.Now.Month + 4 y = DateTime.Now.Year - 1 End If For i As Integer = 1 To m If i > 4 Then CreateFolder(y + 1, i - 4) Else CreateFolder(y, i + 8) End If Next assuming you have a procedure to create a folder called CreateFolder that takes the year and month. :)
-
Try: using System.Data; using System.Data.OleDb; DataSet DS; OleDbDataCommand MyCommand; OleDbDataAdapter MyAdapter; OleDbConnection MyConnection; MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; data source=C:\myData.XLS; Extended Properties=Excel 8.0;"); // Select the data from Sheet1 of the workbook. MyAdapter = new System.Data.OleDb.OleDbDataAdapter("select * from [sheet1$]", MyConnection); // READ from Excel DB DS = new DataSet(); MyAdapter.Fill(DS); MyConnection.Close(); // Write to Excel DB MyCommand = new System.Data.OleDb.OleDbCommand("insert into [sheet1$] ([CLIENTS], [ASSIGNMENTS], [sTATUS]) values( '" + cbClient.Text + "', '" + cbAssignment.Text + "', 'PAUSED')", MyConnection); MyCommand.ExecuteNonQuery(); :)
-
Calculate Client Side totals for Datagrid columns-ASP.NET
mark007 replied to Rattlesnake's topic in ASP.NET
In the databound event You can assign a script to run when the textbox entry changes using: Dim txtOT150 As TextBox=CType(e.Item.Cells(1).Controls(0), TextBox) txtOT150.Attributes("OnKeyPress")="RedoSums(this, " & e.Item.ItemIndex & ")" This would then make each textbox call the RedoSums function passing a reference to the row that changed and to the control. If we then perhaps had an array of the old values then the new sum could be calced using OldSum+NewValue-OldValue. e.g. function RedoSums(c,r) { tSum=document.getElementById("txtOT150Total"); tSum.Value=tSum.Value-OldValues®+c.Value OldValues®=c.Value } You would then just need to build an array of the start values when the page loads e.g. var OldValues=new Array(NumRows); OldValues(0)=1; OldValues(1)=2; 'etc. making sure that OldValues has global scope. Another alternative would be to have a javascript function that looped through all the controls and checked if the id contained txtOT1001 (the data grid will generate unique ids for each control but they will contain your template id names). HTH :) -
What do you mean by continously clicks on button? Each click increases by 1? If so then use a gloabl varaible to store the count: Dim Count as Integer=0 Then in the click event have: Count+=1 Me.TextBox1.Text=Count.tostring()
-
What data is in those extra rows? Are there blank lines in the textfile?
-
In that case I'm pretty sure what you are trying to accomplish is not possible. Only possible ways round it that I can think of are: 1. Write code for all possible applications and ask the user/look up in the registry which piece of code is required or 2. write an smtp calss and ask the user for their details then send it yourself.
-
Calculate Client Side totals for Datagrid columns-ASP.NET
mark007 replied to Rattlesnake's topic in ASP.NET
Hmm, could you post the code for your entire setup of the grid? -
Calculate Client Side totals for Datagrid columns-ASP.NET
mark007 replied to Rattlesnake's topic in ASP.NET
Any particular reason for a client side script? Take a look at this article - might do what you need: http://aspnet.4guysfromrolla.com/articles/020503-1.aspx :) -
Change the aspx page to this: <script> function CargarDetalle(id){ window.open('TIdetalle.aspx?id='+id+','DetalleTareas','top=0,left=0,width=800,height=600,status=yes,resizable=yes,scrollbars=yes'); return false; } </script> <asp:DataGrid id="DatosTarea" Visible="False" ForeColor="Black" BackColor="White" BorderColor="Silver" Font-size="8pt" horizontalalign="left" cellpadding="4" AutoGenerateColumns="False" AllowSorting="True" OnSortCommand="Sort_Grid" runat="server"> <HeaderStyle font-bold="True" horizontalalign="Center" forecolor="White" backcolor="Navy"></HeaderStyle> <AlternatingItemStyle BorderColor="White" BackColor="White"></AlternatingItemStyle> <Columns> <asp:BoundColumn id="codigoTarea" HeaderText="Codigo de Tarea" DataField="CodigoTarea" SortExpression="CodigoTarea" /> <asp:BoundColumn HeaderText="Descripcion" DataField="DescripcionCorta" SortExpression="DescripcionCorta" /> <asp:BoundColumn HeaderText="Estado" DataField="DescripcionEstado" SortExpression="DescripcionEstado" /> <asp:BoundColumn HeaderText="Empleado" DataField="CodigoEmpleado" SortExpression="CodigoEmpleado" /> <asp:TemplateColumn HeaderText="Ver Detalles"> <ItemTemplate> <asp:linkButton id="accion" OnClick="javascript:return CargarDetalle(<%# DataBinder.Eval(Container.DataItem,"codigoTarea") %>)" runat="server">Detalle</asp:LinkButton> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> I think that will do it...but apologies if it doesn't I only had 30 secs! :)
-
You could shellexecute a hyperlink mailto:emailaddy@server.com?subject=subject This would do the same as clicking an email address on a web page i.e. open a new mail in the default mail app.
-
That sounds fine to me. With my database setup I have an interface displaying the methods and implement them all differently for different database types. I then declare my variable as IData but assign it to New SQLServerData or New AccessData depending on the db in use. The above is basically equivalent but with some base functionality built in too. :)
-
Right click on my computer Click Manage Under services expsnd IIS Right click on the default website Check your security settings - make sure anonymous access is ticked
-
Firstly - make your code easier to read by using [ vb][/vb ] tags without the spaces to format the code as in my post. I don't understand how edit could fire on that row as the Edit button should have been hidden. Have a read of the articles here: http://aspnet.4guysfromrolla.com/articles/040502-1.aspx In particular part read part 8 that deals with getting a reference to a control in the databind event. The difference is you want to reference the eidt button and hide it rather than adding client script. :)