|
Might there by chance be a method to detect the width of the browser (or even the screen resolution) with ASP.NET?
I tried HttpCapabilitiesBase.ScreenWidthPixels, but I get NullReferenceException when I run it.
I'll use javascript if I have to, but I'd prefer to stick with the ASP.NET.
Thanks ahead of time.
|
|
|
|
|
I found a way to detect screen resolution, but I'd still appreciate a method to detect browser width.
|
|
|
|
|
|
hello frnds,
i want to Upload a file to server, what i want to do is currently i am working on client port and i select a file by input file control and when clicking on Upload the file should be uploaded to the specified path but without the shareing the specified path folder
please..help
thankx a lot in advance
-koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Try this may this help you......
Tell me if this is helpful to you or require somethind clarification......
-Rajesh Jain
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected string UploadButton1_UploadClick(object sender, WebControls.UploadButtonEventArgs e)
{
return Path.GetFileName(e.FileUploadControl.PostedFile.FileName);
/*do database storage of file here...*/
}
}
Rajesh Jain
|
|
|
|
|
You have FileUpload control availabel in ASP.NET 2.0
Use that control for storing the file at the server side
How to use that control get help from GOOGLE
i don't think the post is usefull for to rate it
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi, i have a table in access databse call "code Table" in this table there is only 2 columns, 1 is code number the name. Eg C1 is the code cumber, Horror is the name. other than C1 still have R1, M1. How am i goin to put the different C1, R1 and M1's name in the dropdownlist. am i suppose to select all C1 from code number column? How am i goin to select all code number starting with "C"? N when the user select the name i need to add the code number into the movie table. Please Advice. thanks
-- modified at 4:24 Friday 22nd June, 2007
|
|
|
|
|
user 'like' statement in your qurey. It will select all the value matching specified in like statement "select * from codetable where codenumber like "c%"
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
Thanks a lot. I manage to get it.
|
|
|
|
|
hi. Now i manage to put the codename into the dropdown list. Eg when the user select "VHS" from the dropdown list n when the user press the submit button i only want to add the codenumber which is "M3" into the access database. How am i goin to do that? Do i have to use sql statment or others? Please advice. thanks
|
|
|
|
|
I want to read GPRS data through http in ASP.Net, how can I read these GPRS data comming to my IP let say http://202.67.54.228/readdata.aspx...
I have to read it in readdata.aspx page...
|
|
|
|
|
i am storing cookie object in my project. it is stored in cookies folder in system. it is stored with nam "test@localhost[1].txt". this is not understandable. actually i want to give some meaningful name to it. what to do for that?
|
|
|
|
|
Add the cookie manually
HttpCookie cookie = new HttpCookie("cookie1");//Sets the name of the cookie as "cookie1"
Page.Response.Cookies.Add(cookie);
Hope itll work fine for you...
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
i have an excel file at the server, if i press save button i need to save that file in my local system. how to do it? plz help me...
Pradeep Reddy
|
|
|
|
|
Give a url that will take to the Excel sheet open the Excel sheet in the IE When
a Pop up window will come if you save it will ask you path which is local save it there
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hello to Every one,
There are two panel each containing a text box and and a button.
Panel1 including textbox1 and button1 & Panel2 including textbox2 and button2.
Now i want that after page_load if i select the textbox1 then entire panel2 should not be visible or vice-versa...
Can this is possible without using javascript as i donn't know it...
If not,could you give me The entire code in javascript for doing the above..
Suggest me....
Thank you.
|
|
|
|
|
Don't Repost.
Regards,
Satips.
|
|
|
|
|
Yes you can do it by using javascript.
Now Check Panel in the Brower by clicking right button and view code
i think Panel will get converted into span or similar to like that
Why are you using Panel ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
This is the folowwing coding i download from net...
But it is not working...
<asp:textbox id="TextBox1" tabindex="2" runat="server" width="165" height="24px" textmode="Password">
TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode)
{if((event.which == 13) || (event.keyCode == 13))
{document.getElementById('"+Usr.UniqueID+"').click();
return false;}}
else
{return true};
");
Suuggest me.. what problem is there
|
|
|
|
|
i doubt it contain both server side and Javascipt code in it
Don't use panel use div instead panel put your all controls in these div tags and in javascript write a function that will unable and visible div tags depending on which textBox clicked call this function
here register your javascript from page load in .cs
NameTxtBx.Attributes.Add("OnClick", "javascript:MakeSum('Second');");
AdressTxtBx.Attributes.Add("OnClick", "javascript:MakeSum('first');");
this is javascirpt function
function MakeSum( dats)
{
var tags=document.getElementById(dats);
if(tags.disabled==true)
{
tags.disabled=false;
}
else
{
tags.disabled=true;
}
}
here is the HTML
<div id="first">
<table >
<tr>
<td align="right">
<asp:Label ID="NameLabel" runat="server" Text="Name" Width="52px"></asp:Label></td>
<td>
<asp:TextBox ID="NameTxtBx" runat="server" ></asp:TextBox></td>
<td>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="LastNameLabel" runat="server" Text="LastName" Width="52px"></asp:Label></td>
<td>
<asp:TextBox ID="LastNameTxtBx" runat="server"></asp:TextBox></td>
<td>
</td>
</tr>
</table>
</div>
<div id="Second">
<table>
<tr>
<td align="right">
<asp:Label ID="AdressLabel" runat="server" Text="Adress" Width="52px"></asp:Label></td>
<td>
<asp:TextBox ID="AdressTxtBx" runat="server"></asp:TextBox></td>
<td>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="CityLabel" runat="server" Text="City" Width="52px"></asp:Label></td>
<td>
<asp:TextBox ID="CityTxtBx" runat="server"></asp:TextBox></td>
<td>
</td>
</tr>
<tr>
<td align="right">
</td>
<td>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" Width="70px" /></td>
<td>
</td>
</tr>
</table>
</div>
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi Hemant,
I think, it is not possible without java script. But it can be easily done by Java script.
If possible, dont use panel, use div for it.
Ash
|
|
|
|
|
This is the folowwing coding i download from net...
But it is not working...
<asp:textbox id="TextBox3" tabindex="2" runat="server" width="165" height="24px" textmode="Password">
TextBox3.Attributes.Add("onkeydown", "if(event.which || event.keyCode)
{if((event.which == 13) || (event.keyCode == 13))
{document.getElementById('"+Usr.UniqueID+"').click();
return false;}}
else
{return true};
");
Suuggest me.. what problem is there
|
|
|
|
|
Hi, All
I want to make a bitmap thats Each pixel has different Color.
I defined it size 1024,700 and used three nested Loops 0 to 255 to get unique color and setpixel sets this color to pixel. but my bmp file's pixel still contains duplicate colors,can anyone will guide me.
Thanks again, bye
<br />
int x=0,y=0;<br />
int tot = 0;<br />
Bitmap Bmp;<br />
Bmp = new Bitmap(1024, 700,PixelFormat.Format32bppPArgb);<br />
int h = 0;<br />
for (int i = 0; i <256; i = i + 8)<br />
{<br />
for (int j = 0; j < 256; j = j += 1)<br />
{<br />
for (int k = 0; k < 256; k += 1, x++, h++)<br />
{<br />
if (h > 255)<br />
h = 0;<br />
Color newColor = Color.FromArgb(255,i, j, k);<br />
Bmp.SetPixel(x, y, newColor);<br />
if (x == 1023)<br />
{<br />
x = 0;<br />
y++;<br />
}<br />
if (y >= 699)<br />
{<br />
try<br />
{<br />
Bmp.Save("bmp1.bmp", ImageFormat.Png);<br />
}<br />
catch (Exception ex)<br />
{<br />
Response.Write(ex.Message);<br />
}<br />
return;<br />
}<br />
}<br />
}
Bajrang Singh
Using .net 2.0 (VS2005)
|
|
|
|
|
Hi
Thanks to all of you.
I want to copy a folder with all the contents inside the folder and then paste in any other location or same location with different name. I need your help. pleasesuggest the way in c#. I have to implement this in web application.
Thanks in advance.
Shanti Bhushan
No Defeat Is Final Until You Stop Trying
|
|
|
|
|