|
hello,
pls check object scope, it's mean i think it's not live in memory still raising events of control.
Softy Boy
|
|
|
|
|
Hi there,
Can you try to explicitly specify the ID property for the button control in the CreateChildControls method?
|
|
|
|
|
tried that and it is the same problem
thanks for the reply
goofy
|
|
|
|
|
IMO, in this case the ids of the dynamic buttons are different when the parent control is rendered and when it is created on postback. And as a result of this, the postback event cannot be routed to the button's Command event. You can try debugging your application and double check the ID property of the dynamic buttons and see if this is the case.
|
|
|
|
|
i will try that now,
not sure if this helps but the following code produces two lines of buttons and neither fire the event, normally the button.RenderControl(writer); LOC would fire but as soon as i add the button to a controls control collection it failes everywhere
protected override void Render(HtmlTextWriter writer)
{
EnsureChildControls();
Panel container = new Panel();
foreach (Button button in Buttons)
{
button.RenderControl(writer);
container.Controls.Add(button);
}
container.RenderControl(writer);
}
am debugging extensively as we speak
thank you
g00fy
|
|
|
|
|
When you add the button to the container (panel), it will be removed from its current parent (that I guess is the custom control). When the postback occurs, the dynamic button does not exist as the child control of the panel, and you may notice this thing.
|
|
|
|
|
the approach i have taken, until i can find a better solution is to ...
render all other controls not requiring events, using Panel Controls, and explicitly render the buttons using the writer, and not contain them within another Control.
this works fine, although not perfect for my needs.
thank you *again* for all your help
kind regards,
g00fy
|
|
|
|
|
hello
i'm making a project in asp.met with vb.
I have a .htm file in the my application folder. what I want, I want to read the htm file and want to write some text in this .htm file ona particlualar position.
exactly i have to write the text before the tag by through script.
any body can help me.
|
|
|
|
|
Hi,
Is that .htm file contains simple text are with animations? If text means it's easy to read it using file streame and write your text in that in an specific position
bye
|
|
|
|
|
if the source file is never changed, i.e you always save as a different file and use the source file as a template, this may help.
add a comment into the HTML file, like:
then just do a string replace like so.
string str = System.IO.File.ReadAllText(filepath);
str.Replace("<!-- {PLACEHOLDER} -->", "some text to put into the HTML file");
System.IO.File.WriteAllText(savepath);
otherwise if the file is always changing and you are always needing to insert and not remove then this may help
string str = System.IO.File.ReadAllText(filepath);
str.Replace("</body>", "<script type=\"text/javascript\">alert('script inserted');</script></body>");
System.IO.File.WriteAllText(savepath);
otherwise you will need to use regular expressions i think, unless you can supply more information
hope that helps
g00fy
|
|
|
|
|
hi
thanx for the valuable reply..actually i want to use google analystic into the site.
what is exactly i want to do when any user create his site then this javascript code
"
_uacct="UA-xxxx-x";
urchinTracker();
"
I have to Insert this code before tag.
You suggested that i have place a comment into the Template file.this is ok and will work but measure problem is that when user will upload his template then there will be no Comment then how will get this comment.any suggestion.
|
|
|
|
|
it appears this is a once off insertion, so you can use my last suggestion to replcae the tag and prefix it with your code.
regards,
g00fy
|
|
|
|
|
when i'm trying to ur code then its giving error that ReadAlltext is not a
member of
"System.IO.File"
what should i do.
|
|
|
|
|
it would seem you are using .NET 1.1 and you need to write some more LOC,
try something like this, off the top of my head, haven't used .NET 1.1 for a while now
string str = string.Empty;
using (System.IO.TextReader reader = new System.IO.StreamReader(System.IO.File.Open(path, System.IO.FileMode.Open, System.IO.FileAccess.Read)))
{
str = reader.ReadToEnd();
reader.Close();
}
str = str.Replace("</body>", "<script>// blah blah</script></body>");
using (System.IO.TextWriter writer = new System.IO.StreamWriter(System.IO.File.Create(path)))
{
writer.Write(str);
writer.Flush();
writer.Close();
}
|
|
|
|
|
hello,
thanx a lot..
its working now.
thanx for taking pain for me.
happy progarmming.
|
|
|
|
|
any time
glad to help
|
|
|
|
|
Hello
I'm stucking in another problem, I have to measure the bandwidth of the site.
is there any function by which i can measure the bandwidth
usage by user.
i found that there are some tools which provide this Facility.
but how can i achieve by myself thorugh coding.
plz guide me
any suggestion.
thanx
|
|
|
|
|
Hey,
I question regarding downloading a file. From a page in my application i click a link that opens a popup window - this new window performs some logic on the server side and streams a file to the client, upon which they get the file download dialog (open, save, cancel).
If they choose to open the file, depending on the file type, it may open in a separate window, which is fine, but i then want to close the empty popup window that i am left with.
Anyone any idea how to do this?
|
|
|
|
|
cannot be done, sorry.
client doesn't have handle to the open/save/run dialog so you can't pick up on an event, and the opening window doesn't have a reference of the open window (which launched open/run/save) to close it.
regs,
g00fy
|
|
|
|
|
Hello ,
I am a asp.net c# programmer i am in a problem ie,in my site i get a bulk data from another site it contains online image url also but i have to download that image into my site for i want to resize..can anybody help me to solve this this.ie, how to download an image from one site in dynamic that's it...i am waiting for your reply...alex.
|
|
|
|
|
i need a clearer explanation but can you 'asynchronously' download the image in an iframe, this way your page loads and the iframe can load at its own pace.
i assume you need to get the image url from the bulk data so you can dynamically set the src of the iframe in codebehind to a page on your site and pass that page the images url, then the page loads the image into the iframe
... viola
is this what you mean ?
regards,
g00fy
|
|
|
|
|
Hi
How do I get a webservice to post a message in the EventLog?
Regards
|
|
|
|
|
|
I have a gridview to show data. i need to remove/invisible the vertical line inside the gridview,so the vertical line look like not exist.
I need to set it at stylesheet, so , how i code it at css file ?
Anybody know ? thanks.
Best regards,
Chee ken
|
|
|
|
|
set GridLines property to horizontal or none, then set borders how you please.
hope that helps
g00fy
|
|
|
|