Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have admin panel in that i have one page that is adoutUs that page design is id,text i have to update every time text with single id,but in front-end i have display admin pannel text data, but its displaying all data crossing the design so i want to place link button i.e ReadMore how can i place and how can i give next data to ReadMore link-button(here i am facing problem back-end text data displaying full so i want give data to read more button) Please any body know help me
Posted
Comments
OriginalGriff 5-Mar-11 2:59am    
I'm sure English is not your native language, but it is the default language for this site.
In English, your question makes no sense at all.
Please, either try to find a better translation of your question to English, or find a site in your own native language, as they may be able to help you better than we can!

Check this dirty code.
C#
//get your data from db to a string.
string strTemp = "I have admin panel in that i have one page that is adoutUs that page design is id,text i have to update every time text with single id,but in front-end i have display admin pannel text data, but ";
//check fot number of characters you want to display before read more
if (strTemp.Length > 100)
           {
               if (strTemp.IndexOf(' ', 100) != -1)
               {
                  string  stripped = Regex.Replace(strTemp, @"<(.|\n)*?>", string.Empty);
   //you can redirect using id as query string                
 stripped = stripped.Substring(0, stripped.IndexOf(" ", 50)) + " <a href='default.aspx?redirect=yes'>Read More</a>";                 
                    Label1.Text = stripped;
               }
               else
               {
                  Label1.Text = strTemp;
               }
//check for the query string value.
if (Request.QueryString["redirect"] == "yes")
            {
                Label1.Text = strTemp;//Response.Write(strTemp);
            }
 
Share this answer
 
Comments
Rupa1 5-Mar-11 4:17am    
sir really thx I got solution
Rupa1 5-Mar-11 4:23am    
sir i have one doubt first displaying correct but next time we click on read more it display first data also...............
m@dhu 5-Mar-11 4:25am    
Are you using Response.Write to display?
Rupa1 5-Mar-11 4:29am    
ya i wrote but its displaying out side of design
m@dhu 5-Mar-11 4:31am    
Use a Label control instead. If you are using Response.write the initial data before postback will also be displayed.
If you are using a repeater for binding the data from user end, you can use the following :

C#
private void dataList_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
      if( (e.Item.ItemType == ListItemType.Item) || ( e.Item.ItemType == ListItemType.AlternatingItem))
      {
            HyperLink hyplnk = (HyperLink)e.Item.FindControl("lnkReadmore");
            if (hyplnk.Text.length > 20 )
            {
                 hyplnk.Text = hyplnk.Text.Substring(0,20);
            }
      }
}


If i misunderstand your question, please feel free to correct me.
I hope the above information will be helpful. If you have more concerns, please let me know.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900