|
in asp.net project i have created a 2 web forms and i put one Button On first form in that on click event i have written like this
webfrom2 w2=new webform2
w2.visible=true;
w2.enableviewstate=true
but it will not work how to do?
|
|
|
|
|
actually what u want to do?
regards
GV Ramana
|
|
|
|
|
now i got code to do thank you
another question:
in sql how to combine two columns in to one
how to do it
by view or by query
|
|
|
|
|
select column1+' ' +column2 as CombineColumns from tablename
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
If you trying to access webfrom2 then you have to write this code:
Response.Redirect("webform2.aspx");
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
thats fine it was working
|
|
|
|
|
Hi
I am trying to copy SQL Schema to ORACLE and other RDBMS using C# without using any third party tools. Right now i can able to copy SQL schema to SQL can anybody help me to sort out this problem please very urgent. Also by mistake I posted my question in articles(.NET) tell me how to delete my posted message from the article(I am sorry).
With Regards
kesavan
|
|
|
|
|
|
Hi friends
i have problem to send mail.
when i send mail from my local pc,i got error.
A socket operation was attempted to an unreachable host
when i send mail from server, i got error.
Bad sequence of commands. The server response was: This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
pathan
|
|
|
|
|
i got new error.
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for myid@yahoo.com
pathan
|
|
|
|
|
|
I want to make the ASP.net project to distributable like windows setup project How to do it in asp project
|
|
|
|
|
|
We have something called 'Web Setup Project' in Setup and Deployment of New ... right?
|
|
|
|
|
i am using the below code to initialize the xmlhttprequest
try
{
obj = new XmlHttpRequest();
}
catch(e)
{
try
{
obj = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e1)
{
obj = new ActiveXObject("Msxml2.XMLHTTP");
}
}
it works fine in my system. but when accessed from network, the ajax features doesnt work. I have placed the code for ajax and some validation scripts in the .js file. The validation scripts works fine, but not the ajax scripts.
Please give me solution...
Regards,
Abul.
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
---
b { font-weight: normal; }
|
|
|
|
|
for qstn #1:
the ajax task is to check records in the db whether the name i entered in the textbox exists or not. it displays the message whether it exists or not. when accessed from network, during the event(i.e., on key press) an alert message box displays as "The page is accessing information that is not under its control. This poses a security risk. Do you want to continue ? "
for qstn #2:
if i give "yes" to the alert box, there's no response nor any error message. if i give no, still there is no response and it gives a javascript error as "Permission denied". This error is displayed at the bottom of the window and not as a textbox.
am i clear ?
|
|
|
|
|
Hello,
I wrote a ASP.NET 2.0 application using the Membership framework for security (roles and users). For debugging purposes I wrote some code in the index.aspx page to simply write out a list of all the roles that exist, using the good old Response.Write() method. I then published the site to my domain. However, the behavior of the index page is dependent on the running environment as follows:
IN VS 2005 ACCESSING LOCAL SQLSERVER: Runs great, all roles listed.
IN VS 2005 ACCESSING REMOTE (i.e. "LIVE") SQLSERVER: Runs great, all roles listed.
IN A WEB BROWSER VIEWING THE PUBLISHED APP: @$(&$#*!&$@*& No roles listed.
The really aggravating thing is that the login mechanism still works! If I try to access pages in subfolders protected by a local web.config with roles-based protection, I am denied access until I use the login page. However, once I'm logged in, even though I can access the protected pages both Roles.GetAllRoles() and Roles.GetRolesForUser() return an array of 0 elements.
I need the list of roles b/c my menu rendering routine is roles-based.
How is it even possible that Roles.GetAllRoles() turns up no results and yet the login and access protection mechanisms work perfectly?
Thanks for your help...
|
|
|
|
|
hi friends
i have six value in database.how to bind these values in array
can any one help me?
thanx
regards
saravanan
|
|
|
|
|
U can use List object for that...
Give some detail how u want to do that..
|
|
|
|
|
Please let me know how come all I get back from the server are only parameters (form values) that I am passing in my postURl string?
postURL - full url to the server and fileURL - full url to the local disk where file is stored
Private Function webrequest (ByVal postURL As String, ByVal fileURL As String) As String <br />
<br />
Dim sBoundary As String = Guid.NewGuid().ToString().Replace("-", "") <br />
<br />
Dim encoding As New ASCIIEncoding <br />
<br />
<br />
<br />
'*** Build the post message. <br />
<br />
Dim _StringBuilder As New StringBuilder <br />
<br />
With _StringBuilder <br />
<br />
.Append("--") <br />
<br />
.Append(sBoundary) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("Content-Disposition: form-data; name=\""id\"";") <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("8888888888") <br />
<br />
.Append("--") <br />
<br />
.Append(sBoundary) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("Content-Disposition: form-data; name=\""merch_id\"";") <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("1111111111") <br />
<br />
.Append("--") <br />
<br />
.Append(sBoundary) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("Content-Disposition: form-data; name=\""allow_dups\"";") <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("y") <br />
<br />
.Append("--") <br />
<br />
.Append(sBoundary) <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("Content-Disposition: form-data; name=\""" & "BATCH_FILE" & "\""; filename=\""" & fileURL & "\"";") <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append("Content-Type: application/octet-stream") <br />
<br />
.Append(vbCrLf) <br />
<br />
.Append(vbCrLf) <br />
<br />
End With <br />
<br />
Dim saPostHeaderBytes As Byte() = encoding.GetBytes(_StringBuilder.ToString()) <br />
<br />
<br />
<br />
'*** Build trailing boundary string as a byte array <br />
<br />
Dim saPostTrailingBoundaryBytes As Byte() = encoding.GetBytes(vbCrLf & "--" + sBoundary + vbCrLf) <br />
<br />
<br />
<br />
'*** Calculate the content length. <br />
<br />
Dim _FStream As New FileStream(fileURL, FileMode.Open, FileAccess.Read) <br />
<br />
Dim lLength As Long = saPostHeaderBytes.Length + _FStream.Length + saPostTrailingBoundaryBytes.Length <br />
<br />
<br />
<br />
'*** Create a HTTPWebRequest instance <br />
<br />
Dim _webreq As HttpWebRequest = DirectCast(WebRequest.Create(postURL), HttpWebRequest) <br />
<br />
_webreq.ContentType = "multipart/form-data; boundary=" + sBoundary <br />
<br />
_webreq.Method = "POST" <br />
<br />
_webreq.AllowWriteStreamBuffering = True <br />
<br />
_webreq.ContentLength = lLength <br />
<br />
Dim _reqStream As Stream = _webreq.GetRequestStream() <br />
<br />
<br />
<br />
''-- Write out our post header <br />
<br />
_reqStream.Write(saPostHeaderBytes, 0, saPostHeaderBytes.Length) <br />
<br />
<br />
<br />
' Write out the file contents to server in chunks of 10K <br />
<br />
Dim bytesRead As Integer 'how many bytes were uploaded <br />
<br />
Dim buffer() As Byte 'upload buffer <br />
<br />
'let buffer be the smallest of the two: filesize or 10K <br />
<br />
ReDim buffer(Math.Min(10240, _FStream.Length)) <br />
<br />
bytesRead = 1 'initialize to any number except 0 <br />
<br />
While bytesRead <> 0 <br />
<br />
'read bytes from file <br />
<br />
bytesRead = _FStream.Read(buffer, 0, buffer.Length) <br />
<br />
If bytesRead <> 0 Then 'make sure EOF is not reached <br />
<br />
<br />
<br />
'write bytes to remote server <br />
<br />
_reqStream.Write(buffer, 0, bytesRead) <br />
<br />
End If <br />
<br />
<br />
<br />
'flush streams <br />
<br />
_reqStream.Flush() <br />
<br />
_FStream.Flush() <br />
<br />
End While <br />
<br />
<br />
<br />
' Write out trailer to server <br />
<br />
_reqStream.Write(saPostTrailingBoundaryBytes, 0, saPostTrailingBoundaryBytes.Length) <br />
<br />
'close filestream <br />
<br />
_FStream.Flush() <br />
<br />
_FStream.Close() <br />
<br />
<br />
<br />
'close connection with server <br />
<br />
_reqStream.Flush() <br />
<br />
_reqStream.Close() <br />
<br />
<br />
<br />
'// Finally, we send the request and await the response. <br />
<br />
Dim _webresp As HttpWebResponse = _webreq.GetResponse <br />
<br />
If _webreq.HaveResponse Then <br />
<br />
Dim oStream As Stream = _webresp.GetResponseStream <br />
<br />
Dim oReader As StreamReader = New StreamReader(oStream) <br />
<br />
webrequest_5 = oReader.ReadToEnd <br />
<br />
oReader.Close() <br />
<br />
oStream.Close() <br />
<br />
End If <br />
<br />
_webreq = Nothing <br />
<br />
_webresp.Close() <br />
<br />
<br />
<br />
'dispose of unused objects <br />
<br />
GC.Collect() <br />
<br />
End Function
The code on the posting server is quite simple - just return everything... see below:
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
int loop1, loop2;<br />
<br />
System.Collections.Specialized.NameValueCollection collect =Request.QueryString; <br />
String[] arr1 = collect.AllKeys; <br />
for (loop1 = 0; loop1 < arr1.Length; loop1++) <br />
{<br />
String[] arr2 = collect.GetValues(arr1[loop1]);<br />
for (loop2 = 0; loop2 < arr2.Length; loop2++) <br />
{<br />
myResult += Server.HtmlEncode(arr1[loop1]) + " = " + Server.HtmlEncode(arr2[loop2]) + "<br>";<br />
}<br />
}<br />
<br />
myResult += " Total Received files " + Request.Files.AllKeys.Length + " <br>";<br />
<br />
foreach(string f in Request.Files.AllKeys) <br />
{<br />
HttpPostedFile file = Request.Files[f];<br />
file.SaveAs(Server.MapPath("ReceivedFiles") + "\\" + file.FileName);<br />
myResult += "received file " + file.FileName;<br />
} <br />
<br />
LblResult.Text += "Result<HR> " + myResult;<br />
<br />
}
|
|
|
|
|
hi everyone
I want to make a linkbutton in datagrid (in the first column of the datagrid) and put my code when i click this linkbutton
if any one have idea about that ..i will appreciate that if he/she told me about it
thanks in advance
haitham
|
|
|
|
|
in the property builder, in the columns tab, add one template column. then right click the grid, select that template column. drag and drop a linkbutton into the item template column.
|
|
|
|
|
first i would like to thanks about your attention
.it works with me successfully but establish a new column in the datagrid, i tried to bind the new column opened in datagrid (in design mode) with one of my columns when the datagrids is filled with data(in run mode) but the result is :it opened a new column (column[0]) on the left of my columns
thanks in advance
haitham
|
|
|
|
|
hi friends
my program is create chart dynamically from database values.
but i got error like this
Overload resolution failed because no accessible 'New' accepts this number of arguments.
this is my code
Dim objBitMap As New Bitmap(400, 200)
Dim objGraphics As Graphics
objGraphics = Graphics.FromImage(objBitMap)
objGraphics.Clear(Color.Gray)
objGraphics.DrawString("Charts using ASP.NET", New Font("Verdana", 12), Brushes.Black, New PointF(5, 5))
Dim MyConnection As SqlConnection
Dim connString As String
Dim ReaderObj As SqlDataReader
Dim MyCommand As SqlCommand
MyConnection = New SqlConnection (connstring) MyConnection.Open()
Dim sqlString As String
Dim i As String
sqlString = "Select count(products) as UnitPrice,suppliesId as suppliesId From Products"
'sqlString = "Select count(items) as itemtotal,year as year FROM Items "
MyCommand = New SqlCommand(sqlString, MyConnection)
ReaderObj = MyCommand.ExecuteReader()
Do While ReaderObj.Read()
objGraphics.FillRectangle(New SolidBrush(Color.Blue, (i * 35) + 15, 200 - ReaderObj("UnitPrice"), 20, ReaderObj("UnitPrice") + 5))
this line error
objGraphics.DrawRectangle(Pens.Black, (i * 35) + 15, 200 - ReaderObj("UnitPrice"), 20, ReaderObj(UnitPrice) + 5)
this line error
Loop
'Close objects
'drreader.Close()
MyConnection.Close()
objBitMap.Save(Response.OutputStream, ImageFormat.Gif)
can any one help me
regards
saravanan
|
|
|
|