|
|
Is what I am asking possible?
O.
|
|
|
|
|
Hi,
For my asp.net website project i needed to find the ISP of the user who is accessing the website.
Please help.
Thanks in advance
Jophin
jophin
|
|
|
|
|
jophinmichael wrote: i needed to find the ISP of the user
ISP or IP?
If IP then here [^]is the example
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
The only way you can hope to do that, is if you have a database of IP address ranges which tells you which IPs are assigned for a given ISP. Don't expect to get this for free.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
Hi,
I am using .net membership provider for authentication purpose. I have the following requirement.
If a user first time login to an application and the password hasn’t been changed (assume this user created by admin and the password is provided to user by admin) i should not validate the user until or unless he change the password provided by admin. I dont know how to accompolish this task. I meant how do i come to know tat this is the first time the user login to the application. Is there any property is available in the .net membership provider or any other way.
Help would be greatly appreciated
With Regards,
Anand
|
|
|
|
|
Hey am using repeater control to populate the data using datatable..
in my table the row cells some has values some has 0(zero) value.... i have to make the value of cell as hyperlink/button ..how can i do tht..my table looks like as i given blow..
Could any one suggest me...
Jurdiction 2007 2008 2009
NC 0 6 3
VA 4 0 5
NY 0 7 0
|
|
|
|
|
mahichandu wrote: in my table the row cells some has values some has 0(zero) value.... i have to make the value of cell as hyperlink/button
Well, to treat partiular data case by case, you can not use databind method.
Instead, you should use a loop and add the items. Check the data and if it matches your condition(as you say 0 here), make the that a Hyperlink Column.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hmmmm.. could ou just send me sample code which way i have to add..which event i have to add this looping statements..in Pageload only na...
i don't have much knowledge on C# technolgies..
I am thinking i have to to take new datatable..adding the item & check the data..hear how to prceed..
Could u do this help
|
|
|
|
|
|
There are may ways of doing the same.
I am presenting one way of doing it
I am taking a datatable as my datasource(and ofcourse you have also taken that )
So here it goes
Step 1: Create datatable
DataTable dtSource = new DataTable();
#region Data Table Creation
dtSource.Columns.Add("Jurdiction");
dtSource.Columns.Add("2007");
dtSource.Columns.Add("2008");
dtSource.Columns.Add("2009");
#endregion
#region Add Rows
dtSource.Rows.Add("NC", "0", "6", "3");
dtSource.Rows.Add("VA", "4", "0", "5");
dtSource.Rows.Add("NY", "0", "7", "0");
#endregion
Step 2:Create a repeater control in your .aspx page
<asp:Repeater ID="myRepeater" runat="server">
</asp:Repeater>
Step 3:Bind the datatable to the repeater control which is there in the .aspx page
myRepeater.DataSource = dtSource;
myRepeater.DataBind();
Step 4:Create a user control say Headercontrol.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HeaderControl.ascx.cs" Inherits="HeaderControl" %>
<table width="40%">
<tr>
<td style="width:10%">
<asp:Label ID="lblHeaderCol1" runat="server" Text="Jurdiction"></asp:Label>
</td>
<td style="width:10%">
<asp:Label ID="lblHeaderCol2" runat="server" Text="2007"></asp:Label>
</td>
<td style="width:10%">
<asp:Label ID="lblHeaderCol3" runat="server" Text="2008"></asp:Label>
</td>
<td style="width:10%">
<asp:Label ID="lblHeaderCol4" runat="server" Text="2009"></asp:Label>
</td>
</tr>
</table>
Step 5:Create another user control say ContentControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ContentControl.ascx.cs" Inherits="ContentControl" %>
<table width="40%">
<tr>
<td style="width:10%">
<asp:Label ID="lblContentColumn1" runat="server"></asp:Label>
</td>
<td style="width:10%">
<asp:LinkButton ID="lnkContentColumn2" runat="server"></asp:LinkButton>
</td>
<td style="width:10%">
<asp:LinkButton ID="lnkContentColumn3" runat="server"></asp:LinkButton>
</td>
<td style="width:10%">
<asp:LinkButton ID="lnkContentColumn4" runat="server"></asp:LinkButton>
</td>
</tr>
</table>
Step 6:Expose the following properties in the ContentControl.ascx.cs
#region Properties
public string Jurdiction { get; set; }
public string Content2007 { get; set; }
public string Content2008 { get; set; }
public string Content2009 { get; set; }
#endregion
Step 7: In the Page_Load event of ContentControl.ascx.cs, add the following
protected void Page_Load(object sender, EventArgs e)
{
lblContentColumn1.Text = Jurdiction;
lnkContentColumn2.Text = Content2007;
lnkContentColumn3.Text = Content2008;
lnkContentColumn4.Text = Content2009;
}
Step 8: Call the Header.ascx user control from inside the <HeaderTemplate> of the repeater and the ContentControl.ascx from inside the <ItemTemplate> of the repeater.
It is given below
<asp:Repeater ID="myRepeater" runat="server">
<HeaderTemplate>
<uc2:HeaderControl ID="HeaderControl1" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<uc1:WebUserControl ID="WebUserControl1" runat="server" Jurdiction=<%# DataBinder.Eval(Container.DataItem, "Jurdiction")%> Content2007=<%# DataBinder.Eval(Container.DataItem, "2007")%> Content2008=<%# DataBinder.Eval(Container.DataItem, "2008")%> Content2009=<%# DataBinder.Eval(Container.DataItem, "2009")%> Counter = <%# Container.ItemIndex%> />
</ItemTemplate>
</asp:Repeater>
N.B.~ The various properties that I have exposed from the ContentControl.ascx, are consumed inside the itemtemplate.
So What I am doing?
Basically in the header user control , I have defined the Column names to be printed
and in the ContentUserControl I have attached the cell values to the link buttons.
I am calling the user control from inside the item template ; so each time the user control will be iterated.
N.B.~ This is one of the solutions that came in my mind instantly.
Hope it will help you.
Niladri Biswas
|
|
|
|
|
Hello!
Can someone explain it to me how can I get the DataValue from a listBox. I have one listBox, which is binded with an SqlDataSource, which returns the ID and the Description from a table. I've set the data field to desplay the description and the data field for the value for the list box to the ID. I need when I set the ID from another control to mark the relevant data field in the ListBox and then the other way around. When is some value field chosen from the user in the ListBox I want to get the data field value of the ListBox.
Pleeeease help!
Thanks in advnace!
|
|
|
|
|
Hello All,
I have facing one issue that when i have download any file through file download dialog box before i got message dialog box like
"This page contains both secure and nonsecure items. Do you want to display
the nonsecure items."
can you please tell me how to fixed that issue through code in c#?
That issue only face in IE 6. but in IE 7 it is working fine.
Thanks in Advance.
Anish Patel
|
|
|
|
|
anish27patel wrote: That issue only face in IE 6. but in IE 7 it is working fine.
It does not depend on IE 6 or 7, but the security configuration of the browser.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi all,
i want to store outlook mail to database ??? how can i do that ??
is there any effecient way to do this ???
any hint ??? any example ?
thankx in advnace
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
koolprasad2003 wrote: i want to store outlook mail to database ??? how can i do that ??
is there any effecient way to do this ???
any hint ??? any example ?
ASP.NET does not developed for that !
|
|
|
|
|
Hello,
How can I play rm or Quick Time files on ASPX files.
Thanks
Dad
|
|
|
|
|
hi
I am using visual studio 2005 C#.
In my web application,
I have one web form which is having on link button
I want that when user click on this link, msn messenger must open it is intalled on PC or it should display msg like "Please intalled msn Messenger"
Regards,
ASIF
|
|
|
|
|
Why do you think that this is possible ? You can link to a local file, but you don't have access to the file system. I think you need to read up on what ASP.NET is and how it works.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|
|
If you take a look on the MS / Live site, there's a Messenger control available for embedding into web apps...the same as they usefor Webmessenger
EDIT: Found a link - Live tools[^]
C# has already designed away most of the tedium of C++.
|
|
|
|
|
In my web application, I need to display binary image from database in image web control.
I can convert binary data to image, but how to bind it to Image web control?
Please help me.
|
|
|
|
|
Hi andiyuniar
I've had this issue before. The way I handled it was to "spoof" a content page to change it's ContentType to display images. I would pass it an id via query string and then set the imageurl to the spoofed page.
Here's an example that should help you. Please keep in mind, I don't know if it's the best solution, but it works for me. Also, there could be some performance hits if you have too many images being loaded on your page via this method.
Create a WebForm... i called mine LoadImage.aspx
Place this code in the Load event
if (Request.QueryString["Id"] != null)
{
int Id = Convert.ToInt32(Request.QueryString["Id"].ToString());
byte[] image = null;
if (image!=null)
{
MemoryStream ms = new MemoryStream(image);
Bitmap b = new Bitmap(Image.FromStream(ms));
Response.ContentType = "image/jpeg";
b.Save(Response.OutputStream, ImageFormat.Jpeg);
}
else
{
Bitmap b = new Bitmap(Image.FromFile(Server.MapPath("images/noimage.png")));
Response.ContentType = "image/jpeg";
b.Save(Response.OutputStream, ImageFormat.Jpeg);
}
}
else
{
Bitmap b = new Bitmap(Image.FromFile(Server.MapPath("images/noimage.png")));
Response.ContentType = "image/jpeg";
b.Save(Response.OutputStream, ImageFormat.Jpeg);
}
Then on the page you want to bind your image to just set the ImageUrl property to the webform plus query string.
Image1.ImageUrl = "LoadImage.aspx?Id=1";
Happy Coding
Cheers
Disgyza
Programmer Analyst
|
|
|
|
|
|
I am using jquery in my asp.net 1.1 application.
I am reterving some data using this function:
$(function() {
$("input#btnadd").click(function() {
$.get("RecordPage.aspx",function(response) {
// working on response received.
});
alert('Done');
});
Now my problem is alert('Done'); executed first before response part.
One person's data is another person's program.
--J.Walia
|
|
|
|
|
I would assume that this means it makes the request, then continues. You need to figure out if you can catch an even when the get has ended, and show your message there.
One way to do this, is to put something in the URL that tells it to inject the alert in the page that is being sent.
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
|
|
|
|