|
u don't need the last line of code because the drop down list is already binded and the fields are inserted after the Me.ddlProject.DataBind() statement
let me know if u r still havin a problem ...
Best Regards
3ala2
|
|
|
|
|
hi again,
This statement is thrown at me:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
This is the line it highlighted as the erroneous one:
If ddlProjectRequestSearch.Items(0).Selected Then
Question: Shall I implement a <asp:listitem> tag in the front end code for the "All" option? I'm gonna try that now and see what happens.
|
|
|
|
|
u can do that as a solution
If u wanna keep it as before:
<br />
If ddlProjectRequestSearch.SelectedValue = "All" Then<br />
'The code for all ...<br />
Else<br />
'The code for the rest ...<br />
End If<br />
<br />
<br />
End If<br />
Put this code in the ddlProjectRequestSearch_SelectedIndexChanged and make the postback property "True"
or put it in a button and leave the postback property for the ddlProjectRequestSearch in the default state (False)
This should work fine, i tried it now
Best Regards
3ala2
|
|
|
|
|
I am populating the DropDownList in the PageLoad event. When will the list populate if the code is in the ddlProjectRequestSearch_SelectedIndexChanged method ?
Also, exactly where are we defining the ListItem "All". Since I erased it from the .aspx.vb file shall I make a <listitem> tag for it ?
Sorry bout taking up your time and Thanks.
|
|
|
|
|
The code i wrote doesn't populate the drop down list
this is for the event of selecting an item from the list
and yes, try adding a static item (tag) for it Name "All" and Value "All" so that code would work fine with u.
if it doesn't work try adding it in the code behind
<br />
ddlProjectRequestSearch.Items.Add("All")<br />
No problem man
Best Regards
3ala2
|
|
|
|
|
I'm gonna try this again tomorrow.. I've had enough for today.. I will continue the long thread tomorrow lol...
Thanks again ya akhy..
|
|
|
|
|
|
Actually what i am doing is from IE i am accessing my web site running on asp.net platform. In the datagrid i have given the link. Whwn i click the link
i logon the FTP server and make the socket connection from where i have to start downloading the file.
When i try to acces the IP of the client machine like \\192.168.1.82\c$\abc.iso for downloading the abc.iso file to the client machine, then
i get the error "Logon Failure : Unknown username or bad password"
SAMPLE CODE
***************************************************************
Public Sub DownloadFile(ByVal sFileName As String, _
ByVal sLocalFileName As String, _
ByVal bResume As Boolean)
Dim st As Stream
Dim output As FileStream
Dim cSocket As Socket
Dim offset, npos As Long
'sLocalFileName = "C:\Inetpub\wwwroot\WebDelivery\Downloadfiles\" & sLocalFileName & ".iso"
If (Not (m_bLoggedIn)) Then
Login()
End If
SetBinaryMode(True)
If (sLocalFileName.Equals("")) Then
sLocalFileName = sFileName
End If
If (Not (File.Exists(sLocalFileName))) Then
st = File.Create(sLocalFileName)
st.Close()
End If
output = New FileStream(sLocalFileName, FileMode.Open)
cSocket = CreateDataSocket()
offset = 0
If (bResume) Then
offset = output.Length
If (offset > 0) Then
SendCommand("REST " & offset)
If (m_iRetValue <> 350) Then
'throw new IOException(reply.Substring(4));
'Some servers may not support resuming.
offset = 0
End If
End If
If (offset > 0) Then
npos = output.Seek(offset, SeekOrigin.Begin)
End If
End If
SendCommand("RETR " & sFileName)
If (Not (m_iRetValue = 150 Or m_iRetValue = 125)) Then
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
Do While (True)
m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length)
m_iBytes = cSocket.Receive(m_aBuffer, m_aBuffer.Length, 0)
output.Write(m_aBuffer, 0, m_iBytes)
If (m_iBytes <= 0) Then
Exit Do
End If
Loop
output.Close()
If (cSocket.Connected) Then
cSocket.Close()
End If
ReadReply()
If (Not (m_iRetValue = 226 Or m_iRetValue = 250)) Then
MessageString = m_sReply
Throw New IOException(m_sReply.Substring(4))
End If
End Sub
***************************************************************
Please help as i am struck on this from last 10 days
please help !!!!!!
thanks
Raju sharma
|
|
|
|
|
Greetings people,
First off, you guys will have to excuse me in case my problem is a simple one. Im not a programmer after all.
Anyway, my problem is very simple: Im trying to display the results of my query in a grid on a webpage and I need to be able to do two things:
1.I want to render the first column fixed such that it remains visible whenever the user scrolls from left to right.
2.I want to be able to print the grid such that each page has the column headers and the corresponding row headers( the fixed column that I talked about in my first point above).
I have searched the internet for a web control that can allow me to do this but so far nothing.
Any ideas on how I can achieve this? Any help will be greatly appreciated.
Kind regards,
Pete.
|
|
|
|
|
Hi,
I want to give Exam 70-528: Microsoft® .NET Framework 2.0 Web-Based Client Development so I need help from you, please tell me how to prepare for this exam.
also please let me know if any one has study material/books for this exam.
Thanks in advance
Thanks & Regards
Girish Pendse
|
|
|
|
|
|
hi all
i want to knw how to log off the user of my site if the browser window is closed or the Pc connection was terminated.
thank u all
abdelhameed81
|
|
|
|
|
Guess u need javascript here!
Best Regards
3ala2
|
|
|
|
|
Hi All,
Recently I heard that some companies create a class of each tables present in the database, I will illustrate the same
If there is a table called Employee with EmployeeId, EmployeeName and Salary, then they create a class clsEmployee with EmployeeId, EmployeeName and Salary as their private fields and accessor methods.
And rather than passing the Dataset or XML through the wire, they pass the collection of this objects.
Can anyone tell me what is the advantage of this architecture?, where can I find some articles or guide to implement this architecturte?
Grateful to you all
Sony sebastian
|
|
|
|
|
Guess u should look for the same reasons why to use object oriented programming because what u r talkin about is a simple implementation for object oriented programming
If u want a running ASP.net application (VB Script) send post here
Best Regards
3ala2
|
|
|
|
|
|
Thanks Dude!!!
I will go through all the links you gave.
|
|
|
|
|
Hi all ..I m working on Asp ..i have made a asp application ..which crate text file on Server..After that i want to give facility how to download that txt file on user system..
just like we download attached file from our mail.. to local disk..
Plzzz give me solutions ..
thanx in advance..
Life is not easy ,let's make it.
|
|
|
|
|
I have a question. I have created a class (DBClass) to act as a handler for interactions with a database. Creating an instance of that class opens a connection to the database, and the object then has a number of methods for handing transactions with the database.
Initially, my thought was to include the class definition file (which also creates a single instance of the object, called DB) at the beginning of each document. Then, I thought, I'd be able to reference the DB object anywhere in the page to interact with the database.
So, this is (a simplified version of) what my main page looks like:
<!-- #include virtual="dbclass.aspx" -->
<%@ Register TagPrefix="inc" TagName="title" Src="title.ascx" %>
<html>
<head>
<title>Side Bar Template</title>
</head>
<body>
<inc:title runat="Server" />
</body>
</html>
The dbclass.aspx file contains the code that defines the DBClass class and creates a single instance of that class called DB.
Now, the title.ascx file defines a User Control that prints the title of the page, by looking up the URL of the page in a database and retrieving the corresponding title. That look-up in the database is handled by the DB object:
<%@ Control Language="VB" ClassName="TitleControl" %>
<h1>
<%
Response.Write( DB.GetNameFromUrl( Request.ServerVariables("URL") ) )
%>
</h1>
But when I run the main page, it gives a compilation error then trying to compile the
Title Control, because I reference the DB object without declaring it inside that file (title.ascx).
Any idea how I can get the user control to be "aware" of the main DB object I've defined in the calling page?
Thanks for any help or insight..
----G
|
|
|
|
|
Hi there,
Basically, if you want to access the properties/methods of the calling page, you'll need to get reference to the page instance first, then you can use its members, and from the user control, you can easily access the containing web page using the Page property. Also, if you want to create the DB object in every page, you may think of creating a base class for all web pages and expose this object via a public property in the base class, you later can cast in the Page property in the user control to the base class before calling its members.
In addition, the way you send the output to the web page in the user control is really old, instead you can place a label control in tne control and simply set the Text property. I guess you might be interested in some examples from here[^].
|
|
|
|
|
Hello,
For the past hours I have been trying to solve a problem which is driving me crazy.
I have to different codes where the problem to solve is the same:
CODE 1 (Transforms a XML document using a XSL file):
Function Trans()
Dim doc As XmlDocument = New XmlDocument
doc.Load("doc.xml")
Dim docXsl As XslCompiledTransform = New XslCompiledTransform
docXsl.Load("doc.xsl")
docXsl.Transform(doc, Nothing, HttpContext.Current.Response.Output)
End Function
CODE 2 (Creates XML)
Function Create()
Dim doc As XmlTextWriter = New XmlTextWriter(Response.OutputStream, Encoding.UTF8)
...
doc.WriteStartElement("item")
doc.WriteElementString("title", "My Title")
doc.WriteEndElement()
...
doc.Flush()
doc.Close()
End Function
I don't want to display the XML files. I don't want to save the XML files.
I want to return the XML created from each function.
Then outside of each function I want to display the XML in the browser.
Yes, I read about stream or using a string.
But I was not able to make this work.
Could someone please help me out?
Please, give me a code example.
Thank You Very Much,
Miguel
|
|
|
|
|
Insteaf of using the output stream of the Response object, you create and use a MemoryStream object and at the end of the method you can read from this stream and send the result back to the caller.
|
|
|
|
|
Hi all,
Task:
When user click a button the current window has to be closed and a new window should open to display information. I have to call a function to do certain task before closing this window and opening new.
Problem:
So in the click event of button i wrote:
callFunction();
string script = "@javascript:window.open('PrintMicroResults.aspx','printWindow','toolbar=no,titlebar=no,width=800,height=500,top=50,left=50,scrollbars=yes,resizable=yes');location.href='#';self.close();";
Page.RegisterStartupScript("print", script);
It is closing the current window but not opening the new window for page PrintMicroResults.
I tried the same window.open with in the client side script and its woking very well. i mean its opening new window for my page and closing the current.
But if i use anchor how do i call callFunction() which drive the information to display on page PrintMicroResult?
Can any one help me to make the task successful?
I appreciate the time you have taken.
Thanks a lot.
Cheers
Renu
|
|
|
|
|
You can use the href property of the A element[^] to call the script.
|
|
|
|
|
Yeah i tried it, but the function getting executed after it linked to the new window. But i want to execute the function first and then link to the new window because i am passing some values to the new window in that function.
anything flash in your mind?
Renu
|
|
|
|