|
Putting an image tag in a string doesn't automatically display the image on the page. What do you do with the string after creating it?
---
single minded; short sighted; long gone;
|
|
|
|
|
It seemed to work okay for me. Make sure your image is in the correct location in the file structure and the name is correct. Otherwise, not sure. Maybe try adding ...what browser are you using?
|
|
|
|
|
I when run the program it shows the date I DD/MM/YYYY
But when I publish it in the IIS server date it shows in the MM/DD/YYYY.
Note : Regional setting in the control panel is set to DD/MM./YYYY.
How to retrieve the date in DD/MM/YYYY after publishing?
thank you
vijaya
|
|
|
|
|
Hi,
I am dynamically creating linkbuttons in asp.net c#. After creating the button i have to assign button click event for which i have written the below code.
btn.Click += new EventHandler(btn_Click);
The same works find when i am writing the code in codebehind but since this code is repeated in all the pages i have to use a class, but the problem is that the btn_Click method is in the codebehind page so how can i assign the eventhandler btn_Click event of the parent page while hooking up the event in the class.
Can someone please help me out.
Please see below the code:
protected void CreatePageCounter()
{
int pagesCount = (int)GetPagesCount();
int linkCount = 0;
for (int i = 1; i <= pagesCount; i++)
{
LinkButton btn = new LinkButton();
btn.Text = i.ToString();
btn.EnableViewState = true;
btn.Click += new EventHandler(btn_Click);
plcHldrPageNo.Controls.Add(btn);
plcHldrPageNo.Controls.Add(new LiteralControl(" "));
linkCount++;
}
}
Regards,
Anees
|
|
|
|
|
By defining a delegate in this class, hooking it to the parent class, and then calling that delegate when your event fires ( which you can do inline with an anonymous method if you want ).
Also, make sure you create these before page load, or they will not fire, as they will lose their viewstate.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Thanks for the reply.
I understood what u have said but i need to call the method (btn_Click) in the page itself and just hookup the event in the class. Is it possible.
Regards,
Anees
|
|
|
|
|
I don't see why it's necessary ( it almost certainly isn't ), but unless you put an instance of your page inside the class, and then make the methods that are called public, I don't think it's possible. A delegate that you fire when creating the buttons may do it, also, if it passes the button out, so that it can be hooked up in the outer class.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi all,
I have a GridView control with edit functionality. When a user edits any of the fields and clicks the update button, I need to copy both the old values and the new values entered by the user into a log table. Can someone please advise on how I can achieve the following using VB code? :
1. Get the original values before the edit operation
2. Get the new values entered in by the user (about to be updated)
3. Save the old and new values into a log table
Thanks!
|
|
|
|
|
kumswa wrote: I need to copy both the old values and the new values entered by the user into a log table. Can someone please advise on how I can achieve the following using VB code? :
1. Get the original values before the edit operation
2. Get the new values entered in by the user (about to be updated)
3. Save the old and new values into a log table
Write a Update Trigger on the database side. The value that you are looking for(old values and New values) will be available in the pseudo tables(logical tables). Doing this in the front-end is a wrong coding approach.
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Thanks J O N!
I'm looking for examples of how to do this. There's one in Books online but still a little over my head.
Would still like to know how to do it the ASP.NET way though...
|
|
|
|
|
Before Updating the New values get the old values from the DB by passing the ID as parameter and New values you have. Have these two in DataRow() and then do the Update followed by Insert Into logtable(old vaules and New Values from the DataRow Collection) .
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Hai all,
i am new to .net.
i just want to know ,
if there are two dropdown lists,i populate one dropdown from database table products,then some data about the customer(anothertable) will be populated in second dropdownlist.
and after that ,if i select the customer then data related to first and second dropdown list will be visible in the gridview?
can any body send me the code related to it?
Thanks
Subbu.
|
|
|
|
|
if you are Binding GridView with SqlDataSource then use FilterExpression of SqlDataSource then bind again GridView
example:
SqlDataSource1.FilterExpression = "ColName ='"+getSelectedItemofDropDownList+"'";<br />
GridView1.DataBind();
I Love SQL
|
|
|
|
|
hai,
Thanks for u r reply,
my requirement is second dropdown will be filled relaeted to first one and after that display the gridview.
can u send me the full code?
Thanks
Subbu.
|
|
|
|
|
here is a sample code similar to your situation-- loading cities in dropdown inside gridview based on the state selected from the dropdown outside the gridview. this link will provide you atleast something useful. Have a look...
dropdownlist-inside-gridview[^]
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
hai john,
thank u for reply,but my two dropdownlists are outside the gridview,not in itemtemplate.can u send the code for it?
Thanks
Subbu.
|
|
|
|
|
set the AutopostBack Proeprty of Product Dropdown - True
--This Code is to Populate the First DropDown
--call "subInitializeDropDown" on PageLoad
Private Sub subInitializeDropDown()<br />
Dim LocalDataSet as New DataSet<br />
LocalDataSet = SelectAllProducts()<br />
ddlProduct.DataValueField = "Product_ID"<br />
ddlProduct.DataTextField = "product_Name"<br />
ddlProduct.DataSource = LocalDataSet<br />
ddlProduct.DataBind()<br />
End Sub
--This Code you write in the SelectedIndexChanged Event of Product DropDown
Dim LocalDataSet as New DataSet<br />
LocalDataSet = SelectAllCustomer(ddlProduct.selectedValue)<br />
ddlCustomer.DataValueField = "Customer_ID"<br />
ddlCustomer.DataTextField = "Customer_Name"<br />
ddlCustomer.DataSource = LocalDataSet<br />
ddlCustomer.DataBind()
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
Hai john,
Thanks for u r reply.
it is working
Thanks
Subbu.
|
|
|
|
|
Hi All,
i am working on a web application which saves html file(file consist only formatted text with color, headings, font etc.). i need to write this formatted text to a word file(on click of a button). i am doing it like this:-
// on click of button, i call this function.
private void write()
{
object oMissing = System.Reflection.Missing.Value;
//Start Word and create a new document
Word._Application oWord; // word application object
Word._Document oDoc; // word document object
oWord = new Word.Application();
oWord.Visible = true;
// open new word file
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document.
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
// call a method setContent(), which will return string
(here string will contain html file content(text) like:-
<code><div class="ForumSig"><b>here all my formatted text will go, it can be any number of paragraphs with any type of formatting, but will have text only</b><u><b>CodeProject<b></u></div></code>
)
string tcontent = setContent();
oPara1.Range.Text = tcontent;
// write returned html content(string) to opened word file.
oPara1.Range.InsertParagraphAfter();
}
this is simply what i am doing, this opens a new word file and writes all what my function "setContent()" returns (a string representing html file content).
now problem is that it is writing that string as it is means if string is <code>
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh, then it is writing it same way without converting it as html equivalent like it should be displayed as:-
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily Akhilesh Singh
can any of members have any good idea about how can i write it so it will come as html means all tags will be changed as html equivalent data or (content).. plz plz help me out if any one knows how to?
Thanks Akhilesh
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
akhilesh@slk wrote: i am working on a web application which saves html file(file consist only formatted text with color, headings, font etc.). i need to write this formatted text to a word file
An easy solution would be changing the HTML extension to .doc and save. This works for me.
|
|
|
|
|
Yes Navaneeth this will work for some situation, in my case i am using a third party tool for text editing. user can enter any text on that tool(supports formatting through it's own options on tool) and click on on save button, then i need to save the content in database, those content will be like having color , fond, and some other properties for faormatting the text(including text too).
this tool has one prorerty named as "content", i can only access user entered text with this property "content", which always holds string of all above proerties(like font etc with user entered text) which i just reffered.
when i will take this string and save to database it will saved as it is(proerties + text). when i open a word document and assign this string(which i will retirieve from database in a string) to a paragraph and will write to word, it will take whole string and write it as it is like if html content was <b>"People"</b> it will write <b>People often</b> into the word, not like just making "People" as bold(i mean it will ignore all html tags and consider those as normal set of characters only and will write tags too).
so i think it is something different from the condition for which this suggestion might have work for you.
if i am wrong please let me know...
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
-- modified at 8:17 Tuesday 11th September, 2007
|
|
|
|
|
How can we authenticate users in http handlers. I mean only allow users who are authenticated to use the http handlers ???
ppl that are in a certain page.
Is there anyway to see on server side wether a user calling the XmlRequest.open(...);XmlRequest.send(); method is on the page we want .??
|
|
|
|
|
How do u use IIS to publish a site in my network i'm totaly stuck
can anyone help me
|
|
|
|
|
i want to help you but for that regards plz explain your problem properly, because to publish a site there is no use for IIS. Tell me what excatly you want to do.
regards
Yogesh
|
|
|
|
|