|
Hi
I've done that with a Web Service returning a byte[]. Then I create an image dynamically with this data.
More info here[^]
Hope it helps.
Cheers
Laurent
|
|
|
|
|
Hai i am new to asp.net i have small problem , i was useing asp.net2003 and sqlserver as backend
problem is :
i have login page with uid and password (textboxes)
when user enter valid user& password user enter into next page
table contain uid,password,username,usercode
userid=010101 password =010101 username='ramesh' usercode=01
userid like =010101 based on that first two digits i have diaply username into second page
how to use substring query in that
plz help me it is urgent
prasad.g
|
|
|
|
|
Do you want to get the first two characters of the strng?
if so then you can use like this:
userid.Substring(0,2);
Best Regards,
Apurva Kaushal
|
|
|
|
|
Prasad.garlapati wrote: based on that first two digits i have diaply username
Prasad.garlapati wrote: ,username,usercode
username = username.Substring(0,2);
if you want to pass in another page u acn use sessions ,querystring,etc
Example:
<br />
Session["twodigits"] = username.ToString();<br />
<br />
<br />
<code>string twodigirs = Session["twodigits"].ToString();
|
|
|
|
|
This is a useless subject line.
Everyone who starts a thread on this forum is looking for help in some form or another.
Saying that it is "urgent" is pointless too. We are not paid to give you support. You'll get help if someone knows the answer and is willing to help and for no other reason. If it really is urgent then I suggest that you pay for support.
|
|
|
|
|
I just deployed a new web and my global error handler is sending me back of
ton of nessages that say "Invalid_Viewstate_Client_Disconnected" complete
with a complete copy of the viewstate - very helpful I am sure. I can't seem
to duplicate the problem. What's up?
Error Msg :
Invalid_Viewstate_Client_Disconnected Client IP: 10.6.174.41 Port:
1639 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
..NET CLR 1.0.3705; .NET CLR 1.1.4322) ViewState:
please help
Praveen
|
|
|
|
|
May be the problem is because all the contents of viewstate from client side are not coming to server side. Are all the settings correct in IIS?
Best Regards,
Apurva Kaushal
|
|
|
|
|
There are several conditions that may cause this issue. Each known condition is presented with a short explanation and a possible workaround.
1. Application Pool Recycling
2. Server Farms or Server Clusters
3. Form Posts
4. Proxy servers and Virus Scanners
Background:
Viewstate represents the state of the page when it was last processed on the server. The contents of the page are stored in a container and moved to and from the server on each request. By default, ASP.NET validates the contents of viewstate to ensure that it has not been tampered. If this validation test fails, an invalid viewstate exception is thrown. Some known issues that cause this test to fail are listed below.
Application Pool Recycling:
IIS 6 will periodically recycle the application pool to maintain the health of the application pool. At the instance when the application pool is being recycled, browser requests may sometimes result in an invalid viewstate error. The fix in this case is to adjust the settings on the application pools so that recycling is less likely to occur at peak periods. This issue represents a bug since the application pool is supposed to gracefully handle this condition.
Server Farms or Server Clusters:
Applications running in a server cluster must have all the machineKey configurations set to the same validationKey. The default autogenerate key cannot be used in a cluster environment. The registry keys responsible for autogeneration are listed here:
HKEY_LOCAL_MACHINE\Software\Microsoft\ASP.NET
HKEY_CURRENT_USER\Software\Microsoft\ASP.NET
When the machineKey is set to AutoGenerate, the key information is stored in the HKEY_CURRENT_USER hive for the account running the process. For W2k3 servers, this is the Network Service account. Otherwise, the account is ASP.NET machine account. When the process launches, ASP.NET will use the HKEY_CURRENT_USER registry key if it is available. If this key is not available, the
HKEY_LOCAL_MACHINE key will be used. If neither registry key exists, the process creates the key in the HKEY_LOCAL_MACHINE hive. If these conditions fail, the process creates a brand new set of keys.
When the application pool is running under a user account, the above keys are not generated leading to an intermittent invalid viewstate error.
The workaround is to use a specific key in the machine.config to prevent automatic key generation on each process start. The key must be exactly 128 bits made up of random characters and inserted into the configuration file on each webserver experiencing the problem.
Form Posts:
Viewstate can only be posted back to the same page. Attempting to post an aspx form to another page will fail with a viewstate invalid exception. This behavior is by design.
One other remedy involves disabling the Machine Authentication Check. Unless, you implement a back up authentication mechanism, you should refrain from this approach. Machine Authentication Checks are important in reducing the attack surface of ASP.NET applications.
Proxy servers and Virus Scanners:
A firewall and/or antivirus software can tamper with the viewstate resulting in an invalid viewstate exception being thrown.
Thanks,
Bimal Kothari
bimal.kothari@gmail.com
|
|
|
|
|
can anyone help me to read the nodes and values of a XML to a multidimensional array.there is only single parent node for my xml page.
Vipin
|
|
|
|
|
Hi Vipin,
You can use a For each statement to read all the nodes in an XmlDocument. the XmlDocument will contain the xml data from a file, i guess. You can do something like this-
XmlDocument xmlDoc = new XmlDocument();
int i=0;
string[] arrString = new string[20];
XmlNode tempNode, xn;
xmlDoc.Load("c:\sample.xml");
xn = doc.DocumentElement;
ForEach(tempNode In xn.ChildNodes)
arrString[i] = tempNode.InnerText;
i++;
Next
doc.Save("c:\sample.xml");
Hope this helps. The code i wrote is not compiled. tell me if gives some error, i will correct it.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
i have three pages in asp.net.
1.from first page(first.aspx) display second page (second.aspx) in newwindow using window.open()
2.then from second page(second.aspx) display third page(third.aspx) in newwindow using window.open() and close window
3.then from third page(third.aspx) close window and refresh first.aspx
Mahendra
|
|
|
|
|
As you close the second window, you have no way of reaching the first window from the third window. You have to get the reference to the first window, and pass it from the second window to the third window before you close the second window.
---
b { font-weight: normal; }
|
|
|
|
|
mbsum wrote: i am not getting solution can u explain me if u have time
thanks
Mahendra
After you have opened the third window, wait for it to load, so that you can get the value of window.opener from the second window to the third window.
Perhaps you should run a script onload in the third window that stored the reference window.opener.opener and then closes the second window.
-- modified at 2:31 Wednesday 9th August, 2006
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I am making a photoalbum in asp.net (vbcode). All the pictures should be pickedup from particular directory. I have added a datalist with image and also a repeater control also with image and an array. The codes are as follows.
sub getphoto
Dim photo As String() = System.IO.Directory.GetFiles("C:\pravin\b\shkecellphone", "*.jpg")
Dim dir As System.IO.DirectoryInfo = New System.IO.DirectoryInfo("C:\b")
Dim i As Integer = System.IO.Directory.GetParent("C:\b").FullName.Length
Dim ix As Integer = 0
'Image2.ImageUrl = "C:\pravin\b\shkecellphone\p.jpg"
Dim p As New ArrayList
Dim obd As New PagedDataSource
Do While ix > photo.Length
photo(ix) = photo(ix).Substring(i + 1)
' photo(ix) = photo(ix).Replace("\\", "/")
p.Add(photo(ix))
ix += 1
Loop
Image2.ImageUrl = photo(2)
Label1.Text = photo(ix).ToString
'DataList1.DataSource = photo.CopyTo(DataList1.Items)
obd.DataSource = photo
'datalist2.datasource = photo
'even this is not working this also show then the image empty
DataList2.DataSource = dir.GetFiles("*.jpg")
Repeater1.DataSource = dir.GetFiles("*.jpg")
Repeater1.DataBind()
DataList2.DataBind()
End Sub
The Problem is when i am running it I am not able to see the picture, its is able to count and show the same no of image icon and also the path but its all empty.
kindly let me know whats wrong in this code or what is lacking and any other way the datalist item image or repeater image show the images. Pls feel free to ask me if you want to know more about.
Thanks in advance
|
|
|
|
|
I am using javascript to open a popup window on a ImageButton click.
My Page_Load contains this code
btnNew.Attributes.Add("onclick","popNew()");
this is my javascript
<br />
function popNew()<br />
{<br />
window.showModalDialog("popNew.aspx", null,"center:yes;resizable:no;dialogHeight:500px;dialogWidth:410px");<br />
}<br />
When I click on the ImageButton btnNew the first time, the Page_Load for popNew fires. I save the details in the form and I do a Response.Write("<script type='text/javascript'>window.close()</script>");
From the main form when I click the button for the 2nd time or more, the Page_Load for popNew doesnt fire.
I am storing some some data in a hidden asp.net textbox in popNew. I clear the data just before I do window.close() but when I click the button in the main form and come to the popup the data in the textbox still exists.
If I use window.Open(), then I do not have this problem but again I am using modalDialog as I refresh the page from the cs once I know the popup is closed. With window.open my cs code doesnt wait for the popup to close and the refresh takes place before it needs to happen.
Is their something I am missing? What would be an easy solution to this?
Tarakeshwar
MCP, CCIE Q(R&S)
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes.
!sgub evah t'nseod margorp sihT ?sgub naem ayaddahW
|
|
|
|
|
am in the design view of my default.aspx file, if i click on Tools -> Generate Local Resources , its not active, is there anything am missing?? Am using Visual Web Developer 2005 Express Edition.
Help Please.
Thanks
----------------------------------------------------------------
where there is a will there is a way
|
|
|
|
|
how to handle keyboard events, keypress e.g., of data grid on client side
|
|
|
|
|
You can use a Javascript event PressNewKey on the client side
Rgds,
aLi
|
|
|
|
|
but how? i want to highlight next row on the datagrid form the current row using arrow up & arrow down key.
|
|
|
|
|
How can i link my menu items with javascript code.any help is appreciated.
E-Ramu
|
|
|
|
|
Hi
Is there any article or library to incoperate Electronic Clearing House services in our projects.
http://www.echo-inc.com[^]
Thanks in Advance.
-- modified at 2:44 Tuesday 8th August, 2006
|
|
|
|
|
Hi,
I have a web application and I need to call a different window
application (exe file) from my web application.
Is it possible? How do I do that? Can I transfer parameters to that exe
file from my web application?
Thanks,
Thanh Tri.
Le Thanh Tri
|
|
|
|
|
Use Process.Start()[^] to start running a program
|
|
|
|
|
It doesn't work????
I have already try it. It work easily on Windows Application but in web application, it start process but the new window don't appear.I mean to say when i start process of NODEPADE, it start process but the nodepad window does't appear.
Rgds,
aLi
|
|
|
|
|
Hi,
Iam implementing shoppingcart.In that i placed a Gridview with columns Name,price,picture,checkboxfield(select).
User select the items from the gridview and click on ADDCART Button which is outside of GridView.
when user click ADDCART button,the rows in the gridview for which checkbox field checked that vales iam storing in a datatable.
for this ADDCART button click event i wrote the following code:
int c=0;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (isChecked)
c++;
}
Response.Write(c.ToString());
//This code only to check.
Eventhough i checked 2 checkbox fields,and click on ADDCART
The c value is 0.
Anything wrong in the above code.
Or Give me some idea on How to ADD user selected items to CART.
Please help me.
Thanks in advance
|
|
|
|