|
check for popup blocker at server...
use a pure HTML pge with only a single button...code javascript to open popup window onclick event of that button...(BUTTON IS IN HTML....i.e INPUT TYPE=BUTTON)
check whether it is working...
Ashish Sehajpal
|
|
|
|
|
Hi All,
I am using C# asp.net 2.0 and ajax1.0.
I am trying to fill dropdownlist using ajax cascading toolkit but I am not able to populate the dropdownlist.
My question is how do I take input value of parent dropdownlist in web service the fill the data that is in my senario I have subprod parent (fill on page load) and then
Prod fill on subprod selection.
The web service method I used is
public CascadingDropDownNameValue[] GetProd(string knownCategoryValues, string category)<br />
{<br />
<br />
StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);<br />
string subgrp = null ;<br />
if (!kv.ContainsKey("PGM_GRP_CODE") )<br />
{<br />
return null;<br />
}<br />
<br />
DsprdTableAdapters.SPGETPRODUCT_GIVENSUBTableAdapter prd = new DsprdTableAdapters.SPGETPRODUCT_GIVENSUBTableAdapter();<br />
Dsprd.SPGETPRODUCT_GIVENSUBDataTable prdgrp = prd.GetProd(subgrp);<br />
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();<br />
foreach (DataRow dr in prdgrp)<br />
{<br />
values.Add(new CascadingDropDownNameValue((string)dr["PM_PRD_NAME"], dr["PM_PRD_CODE"].ToString()));<br />
}<br />
return values.ToArray();<br />
<br />
<br />
}<br />
<br />
and <br />
cascading toolkit I definded as <br />
<br />
<ajaxToolkit:CascadingDropDown ID="cddPROD" <br />
runat="server" <br />
TargetControlID="Ddlproduct" <br />
ParentControlID="Ddlsubdiv" <br />
Category="Prod" <br />
PromptText="Choose a Product...." <br />
LoadingText="Please wait ..." <br />
ServicePath="../Prod.asmx" <br />
ServiceMethod="GetProd" /> <br />
<br />
Pleases Suggest
regards
imran khan
|
|
|
|
|
I have one link button and 8 image buttons in my page. First time when the page is loaded, the link button is not appearing as a link. It looks like normal text. When I click on one of the Image Buttons the page will refresh and now onwards Link Button will appear as a link. Anyone have an idea?
|
|
|
|
|
Yes, your code is broken. Hard to say more without seeing it, I'd guess you have a problem with order of functions being called.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
This is the aspx code:
<tr>
<td width="14" style="height: 83px"> </td>
<td width="108" style="height: 83px"><asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/userimages/saj123.jpg" OnClick="ImageButton2_Click" Height ="79px" Width ="106px" /></td>
<td width="6" style="height: 83px"> </td>
<td width="106" style="height: 83px"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/userimages/sree123.jpg" OnClick="ImageButton2_Click" Height ="79px" Width ="106px" /></td>
<td width="7" style="height: 83px"> </td>
<td width="107" style="height: 83px"><asp:ImageButton id="ImageButton3" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td width="7" style="height: 83px"> </td>
<td style="height: 83px; width: 107px;"><asp:ImageButton id="ImageButton4" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td style="height: 83px; width: 11px;"> </td>
</tr>
<tr>
<td width="14" style="height: 19px"></td>
<td width="108" align ="center" valign ="top" style="height: 19px"><span style =" color :White; font-family :Verdana ; font-size :8pt; font-weight :bold ">Sajana</span></td>
<td width="6" style="height: 19px"></td>
<td width="106" align ="center" valign ="top" style="height: 19px"><span style =" color :White; font-family :Verdana ; font-size :8pt; font-weight :bold ">Sreejith</span></td>
<td width="7" style="height: 19px"></td>
<td width="107" style="height: 19px"></td>
<td width="7" style="height: 19px"></td>
<td style="width: 107px; height: 19px" ></td>
<td style="width: 11px; height: 19px" ></td>
</tr>
<tr>
<td height="82"> </td>
<td height="82"><asp:ImageButton id="ImageButton5" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td height="82"> </td>
<td height="82"><asp:ImageButton id="ImageButton6" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td height="82"> </td>
<td height="82"><asp:ImageButton id="ImageButton7" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td height="82"> </td>
<td height="82" style="width: 107px"><asp:ImageButton id="ImageButton8" onclick="ImageButton2_Click" runat="server" Width="106px" ImageUrl="~/userimages/saj123.jpg" Height="79px"></asp:ImageButton></td>
<td height="82" style="width: 11px"> </td>
</tr>
</td>
</tr>
<asp:LinkButton ID="link1" runat ="server" ForeColor ="Chocolate" Text ="View More" CssClass ="style4 style5" OnClick="link1_Click" ></asp:LinkButton>
The following is the code behind
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("MyPage.aspx");
}
protected void link1_Click(object sender, EventArgs e)
{
Response.Redirect("MyPage.aspx");
}
|
|
|
|
|
Soumini Ramakrishnan wrote: CssClass ="style4 style5"
Might be some styles issue. Do you have anything in page_load ?
|
|
|
|
|
|
there must be a problem with your CSS class
|
|
|
|
|
I think you can have only style in the cssclass, take out the cssclass completly and then try loading the page see what happens
|
|
|
|
|
Yes, It was a css issue . The name of the css class was wrong. Thanks to all
|
|
|
|
|
i want to know the number of hits my application is being hited.i am using asp.net2.0 with c#.
|
|
|
|
|
then write some code to increment a counter every time a page loads.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I think the following code will help you. In your application folder create a text file named "Counter.txt" and put 0 in that file. Write the following in the code behind page.
protected void Page_Load(object sender, EventArgs e)
{
myLabel .Text = counter();
}
public string counter()
{
StreamReader re = File.OpenText(Server.MapPath("Counter.txt"));
string input = null;
string mycounter = "";
while ((input = re.ReadLine()) != null)
{
mycounter = mycounter + input;
}
re.Close();
int myInt = int.Parse(mycounter);
myInt = myInt + 1;
TextWriter tw = new StreamWriter(Server.MapPath("Counter.txt"));
tw.WriteLine(Convert.ToString(myInt));
tw.Close();
re = File.OpenText(Server.MapPath("Counter.txt"));
input = null;
mycounter = "";
while ((input = re.ReadLine()) != null) { mycounter = mycounter + input; } re.Close();
return mycounter;
}
|
|
|
|
|
Well, you should answer the OP, not me. This code also has some big issues. First of all, it is prone to crashing. Never use int.Parse, always use int.TryParse. It's also way too many lines, I could write it in a lot less. Finally, won't it crash if the file does not exist ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
then what is the best solution
|
|
|
|
|
A text file is an OK solution, if the website doesn't have a database behind it
1 - check if the file exists before you open it, if not create it
2 - use int.TryParse so that if the file is corrupt, it resets rather than blow up the site
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
You need some kind of locking. This is not thread safe.
|
|
|
|
|
I was trying not to get too confusing
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
i did not get.could u send me the sample code.i just want to display the number of hits in asmal table or in any graphical image
|
|
|
|
|
I'm sorry, someone gave code, I corrected it, if you can't work it out, then I don't know what else to say.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Best method would be using services like Google analytics[^]. If you want to implement your own tracker, better use database to keep the information, you don't need to worry about thread safety. But keep it in mind, if the application is getting good hits, your database will become huge in size.
|
|
|
|
|
hi guys
i have one problem .
i want to upload a pdf file and want pages of this pdf file as a images in asp.net.
means i have a pdf file and this file have 5-6 pages.and when i will upload this file ,i want these all pages should be upload as separate image in database.
because i want to show all pages in thumbnails images.
if any one of u can help me then it will be gr8 for me
thanks
Ajay Rathi
software engineer
NOIDA(UP),INDIA
|
|
|
|
|
You need to buy a PDF library then
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|