Jump to content
Xtreme .Net Talk

Search the Community

Showing results for tags 'asp.net'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • New Member at Xtreme .Net Talk?
    • Meet and Greet
    • Announcements
  • .NET
    • General
    • Windows Forms
    • ASP.NET
    • Directory / File IO / Registry
    • Database / XML / Reporting
    • Network
    • Graphics and Multimedia
    • Interoperation / Office Integration
    • Deployment
    • Regular Expressions
    • Syntax Specific
  • Knowledge Base
    • Tutors Corner
    • Code Library
    • Quick Tips
  • Xtreme .Net Talk Members Area
    • Water Cooler
    • Suggestions, Bugs, and Comments

Blogs

There are no results to display.

Categories

  • Code Samples
  • Tutorials & Guides
  • Articles
  • Code Downloads

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Occupation


Visual Studio .NET Version


.NET Preferred Language


Skype


Facebook


Twitter ( X )

Found 7 results

  1. Note from moderator: Please use the and [code=visualbasic] tags and other formatting features to make your posts readable. Spelling and grammar help too.[/color] This is in class file [code=visualbasic]Imports Microsoft.VisualBasic Imports System.IO Imports System.Collections.Generic Public Class FileSrch '' File Search Options Public Enum FileSearchOptions YearFirst MonthFirst DateinExtension NormalFiles End Enum Public Shared Function GetSearchcriteria(ByVal DatetoSearchwith As Date, ByVal Filename As String, ByVal FileExtension As String, ByVal SearchOptions As FileSearchOptions) Select Case SearchOptions Case FileSearchOptions.YearFirst Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension) Exit Select Case FileSearchOptions.MonthFirst Return String.Format("{0}_{1:yyyyMMdd}{2}", Filename, DatetoSearchwith, FileExtension) Exit Select Case FileSearchOptions.NormalFiles Return String.Format(Filename + FileExtension) Case FileSearchOptions.DateinExtension Dim ExtensionFormat As String = (Convert.ToInt32(DatetoSearchwith.ToString("mm")).ToString() & DatetoSearchwith.ToString("dd")) '' Month in Double Digit If DatetoSearchwith.Month > 9 Then ExtensionFormat = (DatetoSearchwith.ToString("mmm")(0) & DatetoSearchwith.ToString("dd")) End If Return String.Format("{0}.{1}", Filename, ExtensionFormat) Case Else Return String.Format("{0}.{1}", Filename, FileExtension) End Select End Function Public Shared Function GetFiles(ByVal RootDirectory As DirectoryInfo, ByVal Filename As String, ByVal FileExtension As String, ByVal DatetoSearchwith As Date) As List(Of FileInfo) Dim FiFiles As New List(Of FileInfo) For Each DateOption As FileSrch.FileSearchOptions In [Enum].GetValues(GetType(FileSrch.FileSearchOptions)) FiFiles.AddRange(RootDirectory.GetFiles(FileSrch.GetSearchcriteria(DatetoSearchwith, Filename, FileExtension, DateOption), SearchOption.AllDirectories)) Next Return FiFiles End Function End Class This in Button Click Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim FileName As String ' Dim fileName As String = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf(".")) If txtextension.Text.Contains("_") Then FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf("_")) Else FileName = txtextension.Text.Trim().Substring(0, txtextension.Text.Trim().IndexOf(".")) End If Dim extensionToSearch As String = Path.GetExtension(txtextension.Text) 'Dim Directory As String = Path.GetDirectoryName(txtpath.Text.Trim()) Dim Directory As New DirectoryInfo(txtpath.Text.Trim()) 'Dim filess As String() = Directory.GetFiles(txtpath.Text, txtextension.Text, SearchOption.AllDirectories) 'For Each fiFile As String In filess ' Response.Write(fiFile & "</br>") 'Next Dim SearchedFiles As List(Of FileInfo) = FileSrch.GetFiles(Directory, fileName, extensionToSearch, Now.Date()) 'Dim searchedFiles As List(Of FileInfo) = GlobalStuff.GetFiles(directoryToSearch, "whateverfilename", extensionToSearch, DateTime.Now) If (SearchedFiles IsNot Nothing AndAlso SearchedFiles.Count > 0) Then For Each fi As FileInfo In SearchedFiles Response.Write(fi.Name & "</br>") Next Else Response.Write("No files found") End If End Sub Now,we need to address the following things in that to complete req, If I enter filename_mmddyyyy.txt it should fetch only files having current date in their name in mmddyyyy format.For eg. If I give test_mmddyyyy.txt in txtextension it should return only files with test_10222010.txt and not thee ones with yyyymmdd and all�Right now I am getting all the files created in the current date including the one with ordinary test.txt and also test_20101022.txt ��.And the third thing filename.mdd everything is getting passed correctly but it is not fetching the file ..Again test,test_20101022.txt everything comes.It shouldn�t be like that it should only fetch files with .mdd (current date)�.if we give so��Hope u got� I implemented the normalfiles as u can see above.But in that there is one extra thing we need to address it is if I give ????.???,it should fetch only files like ajay.txt,siva.txt and so on�it should match exactly with the question mark .but what I am getting now is if I give ????.??? in text box I am getting files like nks.txt,nk.tt also�..all lesser files are coming �..? Should match exactly with letters also in extension. Hope you got��If we address the above things then we are done. And please help me in this final step..we are almost done� In my above code i have two text boxes one for file path and other one for getting extension and also for gettting file names with diff search criteria.....What i do is i should implement file search which is like as mentioned below - it should search for all files if i enter *.*,only jpg if *.jpg, and files like nks.txt if i enter ???.???....... if i enter the filename alone without extn it should return me filenames that exist without extension in directories. the final thing is the date in filename where my file will be like filename_mmddyyyy.txt or filename_yyyymmdd.txt or filename.mdd.In first case it should return only files with current date in mmddyyyy format and txt extn....like taht....last case is mdd in extn...where if i enter filename.123,it sould get me files with jan 23(23 currnt date) and for months greater than 9 it is N for nov ,D for dec and so on.But in m,ytext box i will enter only file.mdd only .and also filename_mmddyyyy.jpg like that....
  2. Hello, I've been away from .Net developping for like 6 years, coming back and I had to create a chart, I was really pleased to see this control, but the way it works is kinda annoying, anyway, look at this picture : [ATTACH]5759._xfImport[/ATTACH] These are two charts, both the same one, the only difference is their width and height, but as you can see, on the smaller on, the labels are unaligned. At first I had the same problem with the bigger one, but increasing the distance between the from and to points when including the customlabel fixed it, however the same trick doesn't seem to be working for the smaller one. The points are added this way (these are random points added directly for now, it'll become automated in the future) serie1.Points.AddXY(1, 2000); area.AxisX.CustomLabels.Add(0.5, 1.5, "1"); serie1.Points.AddXY(2, 20000); serie1.Points.AddXY(3, 30000); serie1.Points.AddXY(4, 40000); serie1.Points.AddXY(5, 60000); serie1.Points.AddXY(6, 55000); serie1.Points.AddXY(7, 59000); serie1.Points.AddXY(8, 70000); serie1.Points.AddXY(9, 90000); serie1.Points.AddXY(10, 80000); area.AxisX.CustomLabels.Add(9, 11, "10"); serie1.Points.AddXY(11, 100000); serie1.Points.AddXY(12, 95000); serie1.Points.AddXY(13, 80000); serie1.Points.AddXY(14, 75000); serie1.Points.AddXY(15, 89000); serie1.Points.AddXY(16, 110000); serie1.Points.AddXY(17, 105000); serie1.Points.AddXY(18, 115000); serie1.Points.AddXY(19, 120000); serie1.Points.AddXY(20, 130000); area.AxisX.CustomLabels.Add(19, 21, "20"); serie1.Points.AddXY(21, 115000); serie1.Points.AddXY(22, 110000); serie1.Points.AddXY(23, 120000); serie1.Points.AddXY(24, 125000); serie1.Points.AddXY(25, 124000); serie1.Points.AddXY(26, 135000); serie1.Points.AddXY(27, 140000); serie1.Points.AddXY(28, 155000); area.AxisX.CustomLabels.Add(27, 29, "28"); serie1 is the blue line, area is the ChartArea. Anyone knows how I could make sure that the labels stay on the same row?
  3. Hi xtreme.net people! I'm new here and I would like to get some great advises from you guys. I've been working with VB.Net for quite a long time now but I rarely have chance to get my hands on ASP.Net. With that said, I can say that I am still an amateur when it comes to ASP.Net. Thus, I'd like to get as many advises as I can when it comes to learning and exploring ASP.Net. I already know the basic stuffs but to make sure, I want to know the standard process in creating a professional asp.net website as well. Thanks in advance! Looking forward to your answers.
  4. I am trying to build a Web Application using Visual Studio 2005 and C# 2005. I need to accept a date in a particular textbox. I tried to use AJAX Calendar Extender for the purpose. I have added AJAX Script Manager and CalendarExtender controls to the webpage and set the TargetControlId of CalendarExtender to the proper textbox id. But when I display the webpage (using Debug -> Start Without Debugging) and click inside the textbox nothing happens. I even tried to add an image control to the form and set the PopupButtonId of the CalendarExtender to the image, but even then I am unable to display the calendar control. What am I doing wrong??
  5. I am trying to implement a Login validation using C# 2005 in ASP.net 2.0 web application. The SQL Server database contains a table named "UserList" with columns LoginId, Password and Role. The Login webform should authenticate the LoginId and password and depending upon the Role assigned to that user/visitor should redirect to a specific webform with a pre-defined menu options. The role might be Admin, DEO, Accounts or Member. How should I implement it? I have tried the following: protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { try { string uname = Login1.UserName.Trim(); string password = Login1.Password.Trim(); int flag = AuthenticateUser(uname, password); if (flag == 1) { e.Authenticated = true; Login1.DestinationPageUrl = "~/MenuAdmin.aspx"; } else if (flag == 2) { e.Authenticated = true; Login1.DestinationPageUrl = "~/MenuDEO.aspx"; } else if (flag == 3) { e.Authenticated = true; Login1.DestinationPageUrl = "~/MenuAccts.aspx"; } else if (flag == 4) { e.Authenticated = true; Login1.DestinationPageUrl = "~/MenuMember.aspx"; } else { e.Authenticated = false; } } catch (Exception) { e.Authenticated = false; } } private int AuthenticateUser(string uname, string password) { int bflag = 0; string connString = ConfigurationManager.ConnectionStrings["LoginDemoConnString"].ConnectionString; string strSQL = "Select * FROM UserList where ULoginId ='" + uname + "' AND UPassword ='" + password + "'"; DataTable dt = new DataTable(); SqlConnection m_conn; SqlDataAdapter m_dataAdapter; try { m_conn = new SqlConnection(connString); m_conn.Open(); m_dataAdapter = new SqlDataAdapter(strSQL, m_conn); m_dataAdapter.Fill(dt); m_conn.Close(); } catch (Exception ex) { dt = null; } finally { //m_conn.Close(); } if (dt.Rows.Count > 0) { if (dt.Rows[0][3].ToString() == "Administrator") bflag = 1; else if (dt.Rows[0][3].ToString() == "DEO") bflag = 2; else if (dt.Rows[0][3].ToString() == "Accts") bflag = 3; else bflag = 4; } return bflag; }
  6. ****THIS IS A ASP.NET Web APPLICATION NOT WINDOWS FORMS************* Problem/ Question: To search a child node anywhere in the treeview. I need to type a Node name in the textbox and search the node name in the Treeview and highlight the node name on finding. I don’t how to do it. I tried for sometime but didn’t find the solutions.So, can any body give some idea ? FYI : I have created a ASP.NET Web application treeview to populate Parent nodes and corresponding child nodes for each Parent Node. The user can add any number of child nodes in the treeview. Given below is the code that I have done till now for populating the treeview for any number of childs and child levels. Code behind file : public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack)// Checks if the page is loaded first time { PopulateRootLevel(); // Populates the root or parent } } public void PopulateRootLevel() { SqlConnection objConn = new SqlConnection(@""); SqlCommand objCommand = new SqlCommand(@"select dp.CustomerName,dh.RowId,(select count(*) FROM DistributorHierarchy WHERE ParentID=dh.RowId) childnodecount FROM DistributorHierarchy dh INNER JOIN DistributorProfile dp ON dh.CustomerNumber = dp.CustomerNumber where dh.ParentID = 0 ", objConn); SqlDataAdapter da = new SqlDataAdapter(objCommand); DataTable dt = new DataTable(); da.Fill(dt); PopulateNodes(dt, TreeView1.Nodes); } public void PopulateSubLevel(int ParentID, TreeNode parentNode) { SqlConnection objConn = new SqlConnection(); SqlCommand objCommand = new SqlCommand(@"select dp.CustomerName,dh.RowId,(select count(*) FROM DistributorHierarchy WHERE ParentID=dh.RowId) childnodecount FROM DistributorHierarchy dh INNER JOIN DistributorProfile dp ON dh.CustomerNumber = dp.CustomerNumber where dh.ParentID=@ParentID", objConn); objCommand.Parameters.Add("@ParentID", SqlDbType.Int).Value = ParentID; SqlDataAdapter da = new SqlDataAdapter(objCommand); DataTable dt = new DataTable(); da.Fill(dt); PopulateNodes(dt, parentNode.ChildNodes); } public void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { PopulateSubLevel(Int32.Parse(e.Node.Value), e.Node); } public void PopulateNodes(DataTable dt, TreeNodeCollection nodes) { foreach (DataRow dr in dt.Rows) { TreeNode tn = new TreeNode(); tn.Text = dr["CustomerName"].ToString(); tn.Value = dr["RowId"].ToString(); nodes.Add(tn); tn.PopulateOnDemand = ((int)(dr["childnodecount"]) > 0); } } }
  7. Hi, In a Web Application I have a rdlc file which contains the report output for a form which is wider than it is long. The report shows correctly in the browser and in the pdf viewer/download but once the user goes to print it it prints in landscape. I have played around with it an it appears that it is due to the page width being more than the page height. In the printer dialog it shows landscape (the printer is set to portrait by default). Does anyone know of a solution to this issue? Best regards, O
×
×
  • Create New...