|
Findout where that B... code is lying in your application and delete it immediately.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Its working fine iam retrieving images, but ....
For example : customer may upload 2 - 3 product details with image so we have 10 options to image upload.
So the condition is given like if i click button in new page by checking for karnataka state than all the product pictures should be displayed. because the condition iam checking for karnataka(like that i have to create 26 stats)
here iam receiving all the images as same.(it should be come different images according to that respective products.
krishna
|
|
|
|
|
Your question doesn't really make sense. Are you saying that every product is being rendered with the same image? If so, how are you rendering the images? Check how the URLs are being constructed. You would need to post your code if you want further assistance.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Each and every product having different images, but iam receiving all same images, if i go for the condition.
Html code :
<asp:image id="im1" runat="server"> <asp:image id="im2" runat="server"> <asp:image id="im3" runat="server"> code Behind :
protected void Button1_Click(object sender, EventArgs e)
{
con.Open();
SqlCommand cmd10 = new SqlCommand("select * from onlinegoa2 where state='Karnataka'", con);
SqlDataReader dr10 = cmd10.ExecuteReader();
while (dr10.Read())
{
string x = dr10[4].ToString();
string FileName = x.ToString();
im1.ImageUrl = "./uploads/" + FileName;
}
con.Close();
con.Open();
SqlCommand cmd11 = new SqlCommand("select * from onlinegoa2 where state='Karnataka'",con);
SqlDataReader dr11 = cmd11.ExecuteReader();
while(dr11.Read())
{
string bb = dr11[6].ToString();
string FileName1 = bb.ToString();
im2.ImageUrl = "./uploads/" + FileName1;
}
krishna
|
|
|
|
|
krishnavaradharajan wrote: while (dr10.Read())
{
string x = dr10[4].ToString();
string FileName = x.ToString();
im1.ImageUrl = "./uploads/" + FileName;
}
For each iteration of the loop, you are changing the ImageUrl property of the same object. You need to update the object reference im1 for each iteration of the loop so that it points to the image object that corresponds to the current row of data.
It would be better to use a data-bound control like a Repeater and declaratively define data binding expressions in the template designer.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hello sir
i have one problem in if condition.
in this code first two if condition is run but lastone is not run.
in debugging i saw the pointer is not go to inside { brackets.
it directly go to funStyle().
so guide me write way.
code--------
protected void btnSearch_Click1(object sender, EventArgs e)
{
string strDropdown = drpdwnAnalystName.SelectedItem.Text;
string strSecurityCode = txtSecurityCode.Text;
string strFromDate = dtpFrom.Text;
int flag = 0;
if (flag == 0)
{
funSearchSecurityCode();
}
if (drpdwnAnalystName.SelectedItem.Value == strDropdown
{
funSearchAnalyst();
}
if (dtpFrom.Text == strFromDate
{
funSearchFromDate();
}
funStyle();
txtSecurityCode.Text = "";
drpdwnAnalystName.SelectedItem.Text = "";
}
Gayatri
|
|
|
|
|
niki_nilu wrote: funSearchAnalyst();
Hi,
here in this function are you getting any exception ? check it out and
niki_nilu wrote: if (drpdwnAnalystName.SelectedItem.Value == strDropdown missong braket ??????
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
Your second and third if conditions are missing their trailing parentheses. I presume this is a typo, otherwise your code wouldn't compile.
funSearchFromDate() will only be executed if dtpFrom.Text and strFromData are equal. This comparision is case-sensitive; use String.Compare if you want to do a case-insensitive comparison.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi all
Can any one tell me how to validate a group check box or check box list, i want user to select atleast one check box before he clicks on submit
Thanks
Prakash Mishra(Banglore,India)
|
|
|
|
|
Prakash_Mishra wrote: Can any one tell me how to validate a group check box or check box list
You need to write Client-Side Javascript for CheckBox Validation.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Hi,
do this.
On button's ClientClick Call the function of Javascript.
<script type="text/javascript">
function MyCheckBoxList()
{
var flag=0;
var MyChkLst= document.getElementById ("CheckBoxList ID");
var arrayOfCheckBoxes= MyChkLst.getElementsByTagName("input");
for(counter = 0; counter<arrayOfCheckBoxes.length; counter++)
{
if (arrayOfCheckBoxes[counter].checked)
{
flag=1;
}
else
{
alert("not checked");
return false;
}
}
if(flag==1)
{
alert('checked');
return true;
}
}
</script>
-- modified at 7:41 Wednesday 21st November, 2007
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
for(counter = 0; counter
can u pl write the full code for this line its missing there
Thanks
Prakash Mishra(Banglore,India)
|
|
|
|
|
Thanks a lot
Prakash Mishra(Banglore,India)
|
|
|
|
|
Hi,
you can do that using javascript .
call one common function on each and every checkbox checked and set one flag value in hidden field and check this flag when you submit.
<checkbox onclick="CallMe(this.id)">
function CallMe(id)
{
if(document.getElementByID(id).chekced==true)
{
//set hidden field value to true
}
else
{
//set hidden field value to false
}
}
-- modified at 7:33 Wednesday 21st November, 2007
|
|
|
|
|
i unchecked the annonymous access in internet information services for the virtual directory of my project.now how should i validate whether the user is authorized to view th page.I mean should i create the database for the ip address .i mean the user can be a guest or can be an administrator .how i will get to know whether that one is authoried to view the page?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
If you have bought a book as has been recommended oh so many times, then you need to look in the chapter that is probably titled something like Security or Role Management. There you will find all you need on role and membership providers. You still haven't answered the question that was posed before; do you do this for a living or are you learning this stuff on your own?
|
|
|
|
|
Dear Friends..
I am developing a web application in ASP.net.If any user login to my application(site), i need to get the MAC address of the users machine who are all logging in to my site .How to do it..Some one give the relevant code as early as possible..I need to use this code in my .aspx page itself..
Balaguru
|
|
|
|
|
Check the Request object there you will find the IP address as you get for other OS
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... "
|
|
|
|
|
Dear Sandeep..
Could u be more specific..I am not getting you what u r saying..
Balaguru
|
|
|
|
|
Dear Sandeep..
Could u be more specific..I am not getting u..
Balaguru
|
|
|
|
|
Just check the methods present in Request object like
Request.UserHostAddress i think it will return IP adress of client machine
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 guys,
I have a problem here that I have been unsucessful at solving.
I have a form for user to fill in.
On button click, I perform a series of validations.
Only when the validations pass, I open up a confirm box using javascript.
When the user clicks "OK" I proceed to save the information.
When the user click "Cancel" I refrain from saving the information.
In pseudo code its like this:
btnSave_Click(object sender, EventArgs e)
{
string status= ValidateData();
if(status=="OK")
{
//bring out the confirm box in javascript
ClientScript.RegisterStartupScript(this.GetType(), "ConfirmationPopUp", "getMessage('" + mess.ToString() + "')");
if(userClickOk=="OK")
{
SaveData();
}
}
}
I finally understand that i need a postback from the confirm popup to finally run the SaveData();
So in my java script i try to save the answer in a HiddenField and then on post back check the reply and run SaveData() if the answer is yes.
my Javascript goes like this:
function getMessage(a)
{
var ans;
ans=window.confirm(a);
//ans=;
//alert (ans);
if (ans==true)
{
this.ctl00_ContentPlaceHolder1_HiddenField1.value='Yes';
__doPostBack("","");
}
else
{
this.ctl00_ContentPlaceHolder1_HiddenField1.value='No';
__doPostBack("","");
}
}
However when i try to save the answer in the HiddenField1. I get error that says
this.ctl00_ContentPlaceHolder1_HiddenField1 is null or not an object.
What is wrong? here? I have also tried to save in a session variable which is also not possible?
Please advise how i can achieve this? Is this the right way to do it?
Thanks so much.
|
|
|
|
|
blooper02 wrote: this.ctl00_ContentPlaceHolder1_HiddenField1.value='No';
Hi,
u can not do like this.
Try this.
var MyHDN = Document.GetelementById("Give hidden field's clientID");<br />
MyHDN.value = "No";
-- modified at 0:19 Thursday 22nd November, 2007
Thanks,
Sun Rays
Rate this post if you like answer.
My Articles
|
|
|
|
|
Sun Rays wrote: var MyHDN = Documetn.GetelementByID("Give hidden field's clientID");
MyHDN.value = "No";
wow. That couldnt get more wrong if it tried.
JS is case sensitive. So Documetn [sic] should be document and GetelementByID [sic] would be getElementById .
|
|
|
|
|
It works!
Thanks guys....
My old method this.ctl00_ContentPlaceHolder1_HiddenField1.value='Yes';
works when i created a new webpage but my current project which had a masterpage, it does not work.....
thanks thanks
|
|
|
|